Skip site navigation (1) Skip section navigation (2)

Re: [SQL] OFFSET impact on Performance???

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: PFC <lists(at)boutiquenumerique(dot)com>
Cc: alex(at)neteconomist(dot)com, Greg Stark <gsstark(at)mit(dot)edu>,Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>,Andrei Bintintan <klodoma(at)ar-sd(dot)net>,pgsql-performance(at)postgresql(dot)org
Subject: Re: [SQL] OFFSET impact on Performance???
Date: 2005-01-27 11:19:35
Message-ID: Pine.GSO.4.62.0501271415370.6701@ra.sai.msu.su (view raw or flat)
Thread:
Lists: pgsql-performance
On Thu, 27 Jan 2005, PFC wrote:

>
>>> 	The best part is that you can skip the LIMIT/OFFSET entirely if you 
>>> put page numbers in your cache table while inserting into it, via a 
>>> temporary sequence or something. Retrieving the results will then be very 
>>> fast, but beware that SELECT * FROM table WHERE id =ANY( array ) won't use 
>>> an index, so
>> 
>> contrib/intarray provides index access to such queries.
>
> 	Can you provide an example of such a query ? I've looked at the 
> operators for intarray without finding it.

for example, 
http://www.sai.msu.su/~megera/postgres/gist/code/7.3/README.intarray
see OPERATIONS and EXAMPLE USAGE:

SELECT * FROM table WHERE id && int[]


> 	Thanks.
>

 	Regards,
 		Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Responses

pgsql-performance by date

Next:From: Greg StarkDate: 2005-01-27 12:57:15
Subject: Re: [SQL] OFFSET impact on Performance???
Previous:From: PFCDate: 2005-01-27 10:52:50
Subject: Re: [SQL] OFFSET impact on Performance???

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group