Clive Page <cgp@leicester.ac.uk> writes:
> SELECT myfunc(mycol) FROM table LIMIT 50 OFFSET 10000 ;
> 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 do something like:
select myfunc(mycol) from (select mycol from table limit 50 offset 10000) as x;
I think it's not easy for the optimizer to do it because there are lots of
cases where it can't. Consider if you had an ORDER BY clause on the myfunc
output column for example. Or if myfunc was a set-returning function.
--
greg