pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrus <kobruleht2@hot.ee>
To: pgsql-performance@postgresql.org
Subject: Re: limit clause produces wrong query plan
Date: Mon, 24 Nov 2008 19:26:22 +0200
Message-ID: <gget6m$24rv$1@news.hub.org> (raw)
In-Reply-To: <0e6967e0-fb33-49aa-a745-a1d11ef6a9e0@q9g2000yqc.googlegroups.com>
References: <ggciha$1v26$1@news.hub.org>
	<0e6967e0-fb33-49aa-a745-a1d11ef6a9e0@q9g2000yqc.googlegroups.com>

> 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. 




view thread (7+ messages)  latest in thread

Message-ID: <gget6m$24rv$1@news.hub.org>
Permalink:  ../gget6m$24rv$1@news.hub.org/
Also on:    postgresql.org/message-id/gget6m$24rv$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: kobruleht2@hot.ee
  Subject: Re: limit clause produces wrong query plan
  In-Reply-To: <gget6m$24rv$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox