Re: [PERFORM] Inefficient SELECT with OFFSET and LIMIT

2004-01-06 Thread Greg Stark
Clive Page [EMAIL PROTECTED] writes: SELECT myfunc(mycol) FROM table LIMIT 50 OFFSET 1 ; It looks as if OFFSET is implemented just be throwing away the results, until the OFFSET has been reached. It would be nice if OFFSET could be implemented in some more efficient way. You could

Re: [PERFORM] Inefficient SELECT with OFFSET and LIMIT

2004-01-06 Thread Tom Lane
Greg Stark [EMAIL PROTECTED] writes: Clive Page [EMAIL PROTECTED] writes: It would be nice if OFFSET could be implemented in some more efficient way. You could do something like: select myfunc(mycol) from (select mycol from table limit 50 offset 1) as x; Note that this won't eliminate