Re: [SQL] OFFSET impact on Performance??? - Mailing list pgsql-performance

From Oleg Bartunov
Subject Re: [SQL] OFFSET impact on Performance???
Date
Msg-id Pine.GSO.4.62.0501271332200.6701@ra.sai.msu.su
Whole thread Raw
In response to Re: [SQL] OFFSET impact on Performance???  (PFC <lists@boutiquenumerique.com>)
Responses Re: [SQL] OFFSET impact on Performance???
List pgsql-performance
On Thu, 27 Jan 2005, PFC wrote:

>
>> Thats a really good idea, just store a list of the sorted ids in the
>> temp table - small amount of data for insert... I like it!
>>
>> Alex Turner
>> NetEconomist
>
>     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.

> you'll have to trick the thing by generating a query with IN, or joining
> against a SRF returning the elements of the array one by one, which might be
> better.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>              http://archives.postgresql.org
>

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

pgsql-performance by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Optimizing Outer Joins
Next
From: PFC
Date:
Subject: Re: [SQL] OFFSET impact on Performance???