Re: best way to query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: best way to query
Дата
Msg-id 1857.1201280712@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: best way to query  (Steve Clark <sclark@netwolves.com>)
Ответы Re: best way to query  (Steve Clark <sclark@netwolves.com>)
Список pgsql-general
Steve Clark <sclark@netwolves.com> writes:
> Tom Lane wrote:
>> Also, whatever is the ORDER BY for?

> without the order by it wants to do a seq scan of t_unit_event_log.
> see below:
>   explain select count(*) from t_event_ack_log where event_log_no not
> in (select event_log_no from t_unit_event_log);
>                                         QUERY PLAN
> ----------------------------------------------------------------------------------------
>   Aggregate  (cost=12144872193.82..12144872193.82 rows=1 width=0)
>     ->  Seq Scan on t_event_ack_log  (cost=0.00..12144871485.07
> rows=283497 width=0)
>           Filter: (NOT (subplan))
>           SubPlan
>             ->  Seq Scan on t_unit_event_log  (cost=0.00..40286.56
> rows=1021156 width=4)
> (5 rows)

Hmm, the big problem with that isn't the seqscan but the lack of a
Materialize step to buffer it; which says to me that you're running a
pretty old Postgres version (8.0 or older).  You should think about an
update if you're running into performance issues.

            regards, tom lane

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

Предыдущее
От: "Luis Alberto Pérez Paz"
Дата:
Сообщение: Re: Postgresql + digital signature
Следующее
От: Steve Clark
Дата:
Сообщение: Re: best way to query