Re: zero performance on query

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: zero performance on query
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3417DD6AF@Herge.rcsinc.local
обсуждение исходный текст
Ответ на zero performance on query  (Sidar López Cruz <sidarlopez@hotmail.com>)
Ответы Re: zero performance on query  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
Список pgsql-performance
> look at this:
> select count(*) from fotos where archivo not in (select archivo from
> archivos)
> Aggregate  (cost=4899037992.36..4899037992.37 rows=1 width=0)
> ->  Seq Scan on fotos  (cost=22598.78..4899037338.07 rows=261716 width=0)
>        Filter: (NOT (subplan))
>        SubPlan
>          ->  Materialize  (cost=22598.78..39304.22 rows=805344 width=58)
>                ->  Seq Scan on archivos  (cost=0.00..13141.44 rows=805344
> width=58)
>
> I WILL DIE WAITING FOR QUERY RESPONSE !!!

Try:
select count(*) from fotos f where not exists (select archivo from archivos a where a.archivo = f.archivo)

select count(*) from
(
    select archivo from fotos
        except
    select archivo from archivos
);

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

Предыдущее
От: "Steinar H. Gunderson"
Дата:
Сообщение: Re: zero performance on query
Следующее
От: "Steinar H. Gunderson"
Дата:
Сообщение: Re: zero performance on query