Re: DELETE query and indexes again

Поиск
Список
Период
Сортировка
От Wells Oliver
Тема Re: DELETE query and indexes again
Дата
Msg-id CAOC+FBX+H_PWi9ZoNeqe2FA1L-QtwVwpWCzqGMizQ9K2TqCACA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: DELETE query and indexes again  (Wells Oliver <wells.oliver@gmail.com>)
Список pgsql-admin
So, uses the index:

explain analyze delete from statcast.play_statistics as ps
using stats as s
where ps.gid = s.gid
and ps.guid = s.guid;

It does this:

->  Index Scan using play_statistics_pkey on play_statistics ps  (cost=0.69..8.59 rows=1 width=26) (actual time=0.008..0.065 rows=108 loops=21063)
         Index Cond: ((gid = s.gid) AND (guid = s.guid))

Does not use the index:

explain analyze delete from statcast.play_statistics where gid in (select distinct gid from stats);

It does this:
-> Seq Scan on play_statistics (cost=0.00..7781818.16 rows=96600516 width=10) (actual time=201.521..396052.101 rows=96556116 loops=1)




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

Предыдущее
От: Wells Oliver
Дата:
Сообщение: Re: DELETE query and indexes again
Следующее
От: "Dischner, Anton"
Дата:
Сообщение: AW: Encryption in pg_dump