Re: [ADMIN] Index is not used

2003-12-20 Thread Tom Lane
Ray Ontko <[EMAIL PROTECTED]> writes: > BTW, Are you sure that you need to do the "distinct"? That's a good question to ask. > If you do, > then you might try putting the order_date column first in the > select list. The distinct is requiring that all the rows be sorted > so that they can be un

Re: [ADMIN] Index is not used

2003-12-20 Thread Ray Ontko
Please use "explain analyze" instead of just "explain"; the additional information is very helpful to see where the query is actually spending time. Have you considered clustering on the order_date index? We have seen dramatic improvements in situations where the table is physically ordered by t

Re: [ADMIN] Index is not used

2003-12-19 Thread A.Bhuvaneswaran
> Unsurprising. An inequality condition may require fetching many rows > (the planner is estimating 336289 rows here...) and so an indexscan is > not necessarily quicker. Have you compared actual runtimes with > enable_seqscan on and off? I did run with enable_seqscan off. You are right, the pl

Re: [ADMIN] Index is not used

2003-12-19 Thread Tom Lane
"A.Bhuvaneswaran" <[EMAIL PROTECTED]> writes: > I have a table and an index on it. The index is used when i use '=3D' > operator for the indexed field in the where condition. But the index is > not used when i use '>=3D' operator for the same field. Unsurprising. An inequality condition may requi