473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Performance Problems with ORDER BY

Hi,

i have a performance problem with the following query:

SELECT IMMAND,IPROD,IDESC IIM WHERE IMMAND = 188 ORDER BY IMMAND,
IPROD

I user DB2 V 8.1
The table IIM contains about 200000 records (193000 record with IMMAND
= 188).
Primary key is IMMAND, IPROD.

When im running the query it will take about 45 seconds to get the
first 50 records. I tried the following query

SELECT IMMAND,IPROD,IDESC IIM WHERE IMMAND = 188 AND IPROD > '' ORDER
BY IMMAND, IPROD

This time the query used only 0,5 seconds to give me the first 50
records.

My Question is,
what is the problem with the first query.
Any hints are great.

Juergen Ibach
Nov 12 '05 #1
2 3708
Do you have up to date statistics on the table and its indexes? Is there
an index on IPROD? Can you have a unique index on IMMAND?

Ibach J. wrote:
Hi,

i have a performance problem with the following query:

SELECT IMMAND,IPROD,IDESC IIM WHERE IMMAND = 188 ORDER BY IMMAND,
IPROD

I user DB2 V 8.1
The table IIM contains about 200000 records (193000 record with IMMAND
= 188).
Primary key is IMMAND, IPROD.

When im running the query it will take about 45 seconds to get the
first 50 records. I tried the following query

SELECT IMMAND,IPROD,IDESC IIM WHERE IMMAND = 188 AND IPROD > '' ORDER
BY IMMAND, IPROD

This time the query used only 0,5 seconds to give me the first 50
records.

My Question is,
what is the problem with the first query.
Any hints are great.

Juergen Ibach


Nov 12 '05 #2
Is IPROD > '' a good filter factor?

Check your access plan, sort parameters and take a few snapshots to get more
info.

PM

"Ibach J." <ji****@guskoeln.de> a écrit dans le message de
news:40**************************@posting.google.c om...
Hi,

i have a performance problem with the following query:

SELECT IMMAND,IPROD,IDESC IIM WHERE IMMAND = 188 ORDER BY IMMAND,
IPROD

I user DB2 V 8.1
The table IIM contains about 200000 records (193000 record with IMMAND
= 188).
Primary key is IMMAND, IPROD.

When im running the query it will take about 45 seconds to get the
first 50 records. I tried the following query

SELECT IMMAND,IPROD,IDESC IIM WHERE IMMAND = 188 AND IPROD > '' ORDER
BY IMMAND, IPROD

This time the query used only 0,5 seconds to give me the first 50
records.

My Question is,
what is the problem with the first query.
Any hints are great.

Juergen Ibach

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: serge | last post by:
I have an SP that is big, huge, 700-800 lines. I am not an expert but I need to figure out every possible way that I can improve the performance speed of this SP. In the next couple of weeks I...
8
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run...
8
by: lyn.duong | last post by:
Hi, I have a large table (about 50G) which stores data for over 7 years. I decided to split this table up into a yearly basis and in order to allow minimum changes to the applications which...
16
by: David W. Fenton | last post by:
http://www.granite.ab.ca/access/performancefaq.htm I hope Tony doesn't mind my opening a discussion of some issues on his performance FAQ page here in the newsgroup. This is not meant as...
9
by: bluedolphin | last post by:
Hello All: I have been brought onboard to help on a project that had some performance problems last year. I have taken some steps to address the issues in question, but a huge question mark...
24
by: Bob Alston | last post by:
Most of my Access database implementations have been fairly small in terms of data volume and number of concurrent users. So far I haven't had performance issues to worry about. <knock on wood> ...
115
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
15
by: Együd Csaba | last post by:
Hi All, I've a problem with the perfprmance of the production environment. I've two db servers. One on my laptop computer (2Ghz, 1GB, WinXP, Cygwin, Postgres 7.3.4) and one on a production server...
1
by: jvn | last post by:
I am experiencing a particular problem with performance counters. I have created a set of classes, that uses System.Diagnostics.PerformanceCounter to increment custom performance counters (using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.