informix查询性能问题

发布于 2024-09-28 02:20:03 字数 347 浏览 4 评论 0原文

下面的SQL需要62秒返回:

select getCreditBalance(Customerid)
  from business_apply
 where serialno = '20101013000005'

如何调优?

请详细告诉我。

我只是想知道我应该采取哪些步骤来调整它。 我们使用IDS 9.04。

与在 JDBC 中一样,我无法看到 SETExplain ON 的输出,

我应该在 dbaccess 中执行查询(SETExplain 打开)吗?

我的问题是我无法获得执行计划...如果我能获得它,我会将其发布在这里。

The following SQL takes 62 seconds to return:

select getCreditBalance(Customerid)
  from business_apply
 where serialno = '20101013000005'

How to tune it?

Please tell me in detail.

I just want to know the steps I should do to tune it .
we use IDS 9.04 .

As in JDBC I cant see output with SET Explain ON

shall I execute query in dbaccess (with SET Explain on)?

My problem is I cant get execution plan ...If I can get it ,I will post it here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

左岸枫 2024-10-05 02:20:03

你没有给我们太多工作要做。

基本问题

  • “SerialNo”列的类型是什么?
    • 如果是数字列,请勿引用您要搜索的值。
  • 'SerialNo' 上有索引吗?

指标很重要;类型并不那么重要。

关键问题

  • getCreditBalance() 过程的作用是什么?

辅助问题

  • 您使用的是哪个版本的 Informix?是IDS还是SE还是其他什么?
  • 您上次运行 UPDATE STATISTICS 是什么时候?
  • 连接到数据库是否有问题,或者肯定只是这个查询速度慢?
  • 您使用什么语言提交查询?
  • 是否存在存在巨大延迟的网络?
  • 您运行在哪个隔离级别?
  • Business_Apply 表有多大?
    • 每行的大小是多少?
    • 有多少行?
  • getCreditBalance() 过程还访问哪些其他表?
    • 它们有多大?
    • 他们有合适的索引吗?
  • Informix 服务器运行在什么类型的机器上?
  • 当您运行 SET EXPLAIN 时,查询计划会告诉您什么?
  • 是否有可能您的磁盘出现故障并且操作系统需要很长时间才能读取它?

You've not given us very much to work on.

Basic questions

  • What is the type of the column 'SerialNo'?
    • If it is a numeric column, don't quote the value you are searching for.
  • Is there an index on 'SerialNo'?

The index is important; the type is not so important.

Crucial question

  • What does the getCreditBalance() procedure do?

Auxilliary questions

  • Which version of Informix are you using? Is it IDS or SE or something else?
  • When did you last run UPDATE STATISTICS?
  • Is there a problem connecting to the database, or is it definitely just this query that is slow?
  • What language are you using to submit the query?
  • Are there any networks with huge latencies involved?
  • Which isolation level are you running at?
  • How big is the Business_Apply table?
    • What is the size of each row?
    • How many rows?
  • Which other tables are accessed by the getCreditBalance() procedure?
    • How big are they?
    • Do they have appropriate indexes?
  • What sort of machine is the Informix server running on?
  • What does the query plan tell you when you run with SET EXPLAIN on?
  • Is there any chance you've got a failing disk and the o/s is taking forever to read it?
独木成林 2024-10-05 02:20:03

确保serialno上有索引并调整getCreditBalance函数中的代码。如果不知道它的作用,就很难为您提供任何额外的帮助。

Make sure there is an index on serialno and tune the code in the getCreditBalance function. Without knowing what that does, it's hard to give you any additional help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文