473,231 Members | 1,823 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,231 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 1114

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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.