From: | Kaloyan Iliev <kaloyan(at)digsys(dot)bg> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: OFFSET and LIMIT - performance |
Date: | 2007-06-29 10:33:54 |
Message-ID: | 4684E012.9070709@digsys.bg |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
And what about using cursors and move. Which is faster - OFFSET/LIMIT OR
CURSOR/MOVE.
Best Regards,
Kaloyan Iliev
Tom Lane wrote:
>"Jan Bilek" <bilekj(at)gmail(dot)com> writes:
>
>
>>I'm using PGDB with JDBC. In my app i need to select only portion of all =
>>available rows. I know i can do it two ways:
>>1. I can use OFFSET and LIMIT SQL statements or
>>2. I can select all rows and then filter requested portion in Java.
>>
>>
>
>
>
>>My question - Does the second way significantly affect performance =
>>especially when used with JDBC?
>>
>>
>
>Network transmission costs alone would make the second way a loser.
>
>Large OFFSETs are pretty inefficient because the backend generates and
>discards the rows internally ... but at least it never converts them to
>external form or ships them to the client. Rows beyond the LIMIT are
>not generated at all.
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: Don't 'kill -9' the postmaster
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2007-06-29 13:46:36 | Re: AutoVacuum Behaviour Question |
Previous Message | Albe Laurenz | 2007-06-29 08:57:29 | Re: Create user |