Re: index use again and again - Mailing list pgsql-general

From Tom Lane
Subject Re: index use again and again
Date
Msg-id 21796.1013529275@sss.pgh.pa.us
Whole thread Raw
In response to Re: index use again and again  (Holger Marzen <holger@marzen.de>)
List pgsql-general
Holger Marzen <holger@marzen.de> writes:
> You're right. When the result is small, the index is used. When the
> number of rows is a little bit higher and postgres uses a table scan,
> the query is much slower. The table is not very unordered. Can I force
> postgres to raise the limit where it starts scanning the whole table?

Not directly.  There is code in 7.2 to try to take account of the
effects of table ordering, but it probably needs to be improved.
See cost_index in costsize.c if you are interested.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Index on timestamp field, and now()
Next
From: Andrew Sullivan
Date:
Subject: Re: Function to Pivot data