473,396 Members | 1,666 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,396 software developers and data experts.

Spilled Sorts (better Indexing??)

1
Here is the old query (very slow):

select stgprobillnum
from stgdoc001, icmstri001001 where
targetitemid = '$filename' and
stgdoc001.itemid=icmstri001001.sourceitemid and stgstatus in (4, 5, 6 )

Here is my new query (much faster):

select stgprobillnum from stgdoc001 where stgstatus in (4,5,6)
and stgprobillnum = (select stgprobillnum from
stgdoc001,icmstri001001 where targetitemid = '$FILENAME'
and stgdoc001.itemid=icmstri001001.sourceitemid) with ur


the query is wicked fast.

Here are my indexes:

Indexes Created
Table: ICMUT01058001
STGDOC1_ITEMID (ITEMID)
STGDOC1_ITMSTAT (ITEMID, 1087)
STGDOC1_PROBILL (1097)
STGDOC1_STATUS (1087)

Table: ICMSTRI001001
STG_SOURCEITEMID (SOURCEITEMID)
STGDOC1_TARGET (TARGETITEMID)
STGDOC1_TRGSRCID (TARGETITEMID, SOURCEITEMID)

Although my query is fast, I keep getting spilled sorts.

Any help is appreciated.

Thanks.

Chris.
Dec 1 '06 #1
0 1120

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: BRIAN | last post by:
I have been trying to use a couple of javascripts to sort a table by clicking on column headings. Sorttable.js and tablesort.js which I found on the web... I am encountering one problem. In my...
7
by: Bostonasian | last post by:
I have a table that contains transactional data. Such as site view by whom, when, which template, etc, etc... Everytime when I pulled the report, hh:mm:ss never matters. Only breakdown by dates,...
108
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would...
3
by: rdudejr | last post by:
Hi all, Outside of changing the SQL of the query or creating indexes, what can one do in order to prevent sort spills. Im thinking along the lines of the db cfg and dbm cfg files. Ill post the...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.