RE: Regarding INFORMIX Basic Details
Posted in 2008
-----Original Message-----
>From: informix-list-bounces@iiug.org
[mailto:informix-list->bounces@iiug.org] On Behalf Of Obnoxio The Clown
>Sent: Friday, June 27, 2008 10:04 AM
>To: Sunil Raja
>Cc: informix-list@iiug.org
>Subject: Re: Regarding INFORMIX Basic Details
>> 2. Way to tune a particular SQL Query ?
One thing you can do is before the query runs:
Set explain on;
Select * from whatever (your query);
Set explain off;
It will produce a file called sqexplain.out which will have information
about the query plan in it, like this:
QUERY:
------
select h.this_column, d.other_column
from table_1 h, table_2 d
where h.rec_id = d.rec_id
and rec_date = today - 1
Estimated Cost: 966
Estimated # of Rows Returned: 806
1) h: SEQUENTIAL SCAN
Filters: h.rec_date = TODAY - 1
2) d: INDEX PATH
(1) Index Keys: rec_id (Serial, fragments: ALL)
Lower Index Filter: h.rec_id = d.rec_id
NESTED LOOP JOIN