Re: [GENERAL] Determining offsets to jump to grab a group of records

2008-06-12 Thread David Lambert
Scott Marlowe wrote: Yes there is. Use an indexed id field of some kind. select * from table where idfield between 0 and 100; select * from table where idfield between 100 and 1000100; Will both be equally fast. Offset / limit syntax requires the db to materialize + rows for the query. b

Re: [GENERAL] Determining offsets to jump to grab a group of records

2008-06-11 Thread Scott Marlowe
On Wed, Jun 11, 2008 at 4:39 PM, David Lambert <[EMAIL PROTECTED]> wrote: > > We have already looked into using CURSORS but they must be within a > transaction and we could have many of these grids open at any given time > looking at different tables. > > So the end result is that we are trying to

Re: [GENERAL] Determining offsets to jump to grab a group of records

2008-06-11 Thread David Lambert
David Wilson wrote: This isn't an answer to your direct question, but it seems to me as if you've already decided on a solution (figuring out an offset) that's non-optimal. If you're using offsets at all, you must have a distinct sort ordering; if you have that, you should be able to accomplish t

Re: [GENERAL] Determining offsets to jump to grab a group of records

2008-06-11 Thread David Wilson
On Wed, Jun 11, 2008 at 5:54 PM, David Lambert <[EMAIL PROTECTED]> wrote: > I am trying to find a way to figure out what offset I would have to use in a > SELECT with LIMIT and OFFSET clauses to get a grouping of records. For > example: > > Consider a table full of first names. I want to be able

[GENERAL] Determining offsets to jump to grab a group of records

2008-06-11 Thread David Lambert
I am trying to find a way to figure out what offset I would have to use in a SELECT with LIMIT and OFFSET clauses to get a grouping of records. For example: Consider a table full of first names. I want to be able to find the first offset where the name is "DAVID". (We'll say that it is the