Re: [GENERAL] Questions about LIMIT/OFFSET

2007-10-19 Thread Josh Trutwin
On Fri, 19 Oct 2007 18:19:55 -0500 Michael Glaesemann <[EMAIL PROTECTED]> wrote: > > On Oct 19, 2007, at 16:03 , Josh Trutwin wrote: > > > SELECT * FROM table WHERE foo="bar" ORDER BY abc LIMIT x OFFSET y; > > The server will have to generate at most OFFSET + LIMIT rows, > returning LIMIT row

Re: [GENERAL] Questions about LIMIT/OFFSET

2007-10-19 Thread Michael Glaesemann
On Oct 19, 2007, at 16:03 , Josh Trutwin wrote: SELECT * FROM table WHERE foo="bar" ORDER BY abc LIMIT x OFFSET y; The server will have to generate at most OFFSET + LIMIT rows, returning LIMIT rows or fewer. SELECT * FROM table WHERE foo="bar" ORDER BY abc; This will return all of the

[GENERAL] Questions about LIMIT/OFFSET

2007-10-19 Thread Josh Trutwin
I'm going to be using a smarty plugin to paginate some result sets for display in smarty templates. I was reading that using LIMIT/OFFSET generates multiple query plans so I'm curious if it would be better to do a: SELECT * FROM table WHERE foo="bar" ORDER BY abc LIMIT x OFFSET y; or just: SELEC