Re: query with offset stops using index scan - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: query with offset stops using index scan
Date
Msg-id 20080831195421.GB3856@alvh.no-ip.org
Whole thread Raw
In response to query with offset stops using index scan  ("Stanislav Raskin" <sr@brainswell.de>)
List pgsql-general
Stanislav Raskin wrote:

> Now, if I increase OFFSET slowly, it works all the same way, until OFFSET
> reaches the value of 750. Then, the planner refuses to use an index scan and
> does a plain seq scan+sort, which makes the query about 10-20 times slower:

You may want to try setting enable_seqscan to off before that query (and
making sure you turn it back on; preferably use SET LOCAL inside a
transaction block) so that it gives more preference to the indexscan.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: integer values in conf file
Next
From: M2Y
Date:
Subject: Oracle and Postgresql