Re: limit clause produces wrong query plan

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: limit clause produces wrong query plan
Date: 2008-11-24 17:26:22
Message-ID: gget6m$24rv$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> it was veery fast. To be honest I do not know what is happening?!

This is really weird.
It seems that PostgreSql OFFSET / LIMIT are not optimized and thus typical
paging queries

SELECT ... FROM bigtable ORDER BY intprimarykey OFFSET pageno*100 LIMIT 100

or even first page query

SELECT ... FROM bigtable ORDER BY intprimarykey OFFSET 0 LIMIT 100

cannot be used in PostgreSql at all for big tables.

Do you have any idea how to fix this ?

Andrus.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Kempter 2008-11-24 18:43:56 Monitoring buffercache...
Previous Message PFC 2008-11-24 16:56:31 Re: Perc 3 DC