Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / May 2004

Tip: Looking for answers? Try searching our database.

Performance Problems with ORDER BY

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ibach J. - 28 May 2004 10:51 GMT
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
Blair Adamache - 28 May 2004 11:54 GMT
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?

> Hi,
>
[quoted text clipped - 22 lines]
>
> Juergen Ibach
PM \(pm3iinc-nospam\) CGO - 28 May 2004 23:47 GMT
Is IPROD > ''  a good filter factor?

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

PM

> Hi,
>
[quoted text clipped - 22 lines]
>
> Juergen Ibach
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.