Re: subselect requires offset 0 for good performance.

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: subselect requires offset 0 for good performance.
Дата
Msg-id 5204170D.4020608@dalibo.com
обсуждение исходный текст
Ответ на Re: subselect requires offset 0 for good performance.  (Vik Fearing <vik.fearing@dalibo.com>)
Ответы Re: subselect requires offset 0 for good performance.
Список pgsql-performance
On 08/02/2013 09:37 AM, Vik Fearing wrote:
> EXPLAIN ANALYZE
> WITH RECURSIVE
> x (start_time) AS
> (
>     SELECT generate_series(1, 1000000)
> ),
> t (time, timeround) AS
> (
>     SELECT time, time - time % 900000 AS timeround
>     FROM (SELECT min(start_time) AS time FROM x) AS tmp
>     UNION ALL
>     SELECT time, time - time % 900000
>     FROM (SELECT (SELECT min(start_time) AS time
>                   FROM x
>                   WHERE start_time >= t.timeround + 900000)
>           FROM t
>           WHERE t.time IS NOT NULL OFFSET 0
>          ) tmp
> )
> SELECT count(*) FROM t WHERE time IS NOT NULL;
>
> If you remove the OFFSET 0, you'll see two more subplans (because "time"
> is referenced three times).

Is this not interesting to anyone?

Vik


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

Предыдущее
От: Claudio Freire
Дата:
Сообщение: Re: Efficiently query for the most recent record for a given user
Следующее
От: Robert DiFalco
Дата:
Сообщение: Re: Efficient Correlated Update