If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Update Statistics on composite Index

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-04, 01:26
pathri pathri is offline
Registered User
 
Join Date: Apr 2004
Location: zxczxczxc
Posts: 52
Update Statistics on composite Index

Hi,

I have Three columns in a composite index named rec_ctry_code,airbill_nimber,awb_seq on three tables in the order
(rec_ctry_code,airbill_number,awb_seq).

The distinct rows on each columns are as below
awb_split:rec_ctry_code=7
awbprof:rec_ctry_code=7
awb_app:rec_ctry_code=7

awb_split:airbill_number=739326
awbprof:airbill_number=736641
awb_app:airbill_number=736610


awb_split:awb_seq=4
awbprof:awb_seq=4
awb_app:awb_seq=4


Below is the query..

select awb_split.pieces_scanned, awbprof.*, awb_app.*
from awb_split, awbprof, awb_app
where awb_split.rec_ctry_code="NZ" and
awb_split.airbill_number = 4563123552 and awb_split.awb_seq
= 1
and awbprof.rec_ctry_code = awb_split.rec_ctry_code and
awbprof.airbill_number = awb_split.airbill_number and
awbprof.awb_seq = awb_split.awb_seq and
awb_app.rec_ctry_code = awb_split.rec_ctry_code and
awb_app.airbill_number = awb_split.airbill_number and
awb_app.awb_seq = awb_split.awb_seq
~

1) When i update statistics high on the column heading the indexes(rec_ctry_code) on three tables. The cost is around 8460. When i Update high on awb_split,awb_app the cost is 5278.

When i reverse the Order of the indexes that is airbill_number,awb_seq,rec_ctry_code and update statistics high on airbill_number the cost is much higher.


From this try outs, i come to conclude that the column with less distinct number of rows in a composite index should come first. Is it right ?

What would be the best order of columns in a composite index to yield a good cost estimate.

bye.
__________________
zxczxczc
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On