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 > select in table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-24-07, 10:43
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 283
select in table

Hi gurus informix,

I doing a select in table xxxxx, the field in the where clause is unique index, I am executing set explain and the cost is this.

Estimated Cost: 7668

The table have 3130165 rows.

How can low the Estimated Cost.

Thank you for you help.
Reply With Quote
  #2 (permalink)  
Old 09-24-07, 16:26
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
1) what ids version?
2) copy here all result of set explain and select statment...

if you want to know how make optimization in SQL my suggestion is:
- manual IBM Informix Performance Guide
- slides of IIUG conferences ( www.iiug.org )


here you have links to manual, tutorial, etc..
http://www-1.ibm.com/support/docview...id=swg21250290
__________________
________________________________________
César Inacio Martins
Jundiai / SP - Brasil
http://www.imartins.com.br/informix - em Português
http://www.imartins.com.br/informix - English (translated by Google).
________________________________________
Reply With Quote
  #3 (permalink)  
Old 10-02-07, 04:49
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 283
The version is 9.40 UC7

QUERY:
------
select {+explain avoid_execute} first 1 totgn_rdtotgne_c, totgn_feulttot_k from informix.prtotgne
where totgn_rdcodope_k = 3
and totgn_feulttot_k <= '2007-09-20'
and totgn_rdtipgar_p = 2
and totgn_rdclvope_k = 9999
and totgn_rdmodal_p = 4115
and totgn_rdsubmod_p = 9999
and totgn_rdcodpro_p = 99
and totgn_rdrngimp_k = 99
order by totgn_feulttot_k desc

DIRECTIVES FOLLOWED:
EXPLAIN
AVOID_EXECUTE
DIRECTIVES NOT FOLLOWED:

Estimated Cost: 10629
Estimated # of Rows Returned: 1

1) informix.prtotgne: INDEX PATH

(1) Index Keys: totgn_rdcodope_k totgn_feulttot_k totgn_rdtipgar_p totgn_rdclvope_k totgn_rdmodal_p totgn_rdsubmod_p totgn
_rdcodpro_p totgn_rdrngimp_k (Key-First) (Serial, fragments: ALL)
Lower Index Filter: (informix.prtotgne.totgn_rdcodope_k = 3 AND informix.prtotgne.totgn_feulttot_k <= 20070920 )
Key-First Filters: (informix.prtotgne.totgn_rdcodpro_p = 99 ) AND
(informix.prtotgne.totgn_rdmodal_p = 4115 ) AND
(informix.prtotgne.totgn_rdrngimp_k = 99 ) AND
(informix.prtotgne.totgn_rdsubmod_p = 9999 ) AND
(informix.prtotgne.totgn_rdclvope_k = 9999 ) AND
(informix.prtotgne.totgn_rdtipgar_p = 2 )

Thank you for you help.
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