Re: Does Postgresql have a similar pseudo-column "ROWNUM" as

Поиск
Список
Период
Сортировка
От Alain
Тема Re: Does Postgresql have a similar pseudo-column "ROWNUM" as
Дата
Msg-id 428A3B54.4070902@pobox.com
обсуждение исходный текст
Ответ на Re: Does Postgresql have a similar pseudo-column "ROWNUM" as  (Ragnar Hafstað <gnari@simnet.is>)
Ответы Re: Does Postgresql have a similar pseudo-column "ROWNUM" as
Re: Does Postgresql have a similar pseudo-column "ROWNUM" as
Список pgsql-sql
>>>
>>>No.  What is the purpose of your query?  You could use ORDER BY and
>>>LIMIT..OFFSET to do what you want. I think.
>>
>>The problem is probably speed. I have done a lot of tests, and when 
>>OFFSET gets to a few thousands on a multimega-recs database, it gets 
>>very very slow... 
> 
> 
> is there not a similar loss of speed using ROWNUM on oracle?
> 
> 
>>... Is there any other to work around that?
> 
> 
> if you are ordering by a unique key, you can use the key value
> in a WHERE clause.
> 
> select ... where ukey>? order by ukey limit 100 offset 100;
> 
> (the ? is placeholder for the last value of ukey returned
> from previous select)

I tried that. It does not work in the generic case: 6 MegaRec, telephone 
listing, alphabetical order. The problem is that somewhere there is a 
single user with too many entries (over 1000). I even tried to filter 
the repetitions, but somewhere I get stuck if one guy has too mny 
entries (one for each phone number).

I tried using both the name and the primary key (with a combined index), 
to get faster to the record I want, but I was not sucessfull in building 
a where clause.

I would appreciate any help, in fact this is my primary reason for 
joining this list ;-)

Alain


В списке pgsql-sql по дате отправления:

Предыдущее
От: Postgres Admin
Дата:
Сообщение: Re: ERROR: unterminated quoted string... help
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as