Re: tricky query

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: tricky query
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3415C2BFF@Herge.rcsinc.local
обсуждение исходный текст
Ответ на tricky query  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
Ответы Re: tricky query  (John A Meinel <john@arbash-meinel.com>)
Re: tricky query  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-performance
John Meinel wrote:
> See my follow up post, which enables an index scan. On my system with
> 90k rows, it takes no apparent time.
> (0.000ms)
> John
> =:->

Confirmed.  Hats off to you, the above some really wicked querying.
IIRC I posted the same question several months ago with no response and
had given up on it.  I think your solution (smallest X1 not in X) is a
good candidate for general bits, so I'm passing this to varlena for
review :)

SELECT t1.id+1 as id_new FROM id_test t1
    WHERE NOT EXISTS
        (SELECT t2.id FROM id_test t2 WHERE t2.id = t1.id+1)
    ORDER BY t1.id LIMIT 1;

Merlin

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

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: tricky query
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: tricky query