Re: Index and statistics not used

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Index and statistics not used
Дата
Msg-id CAApHDvpXsKGtAF3tXVu4L=XQ3o5EFWyc4tGjO4FJcPPMU2v-Jw@mail.gmail.com
обсуждение исходный текст
Ответ на Index and statistics not used  (<rstander@exa.co.za>)
Список pgsql-performance
On Tue, 18 May 2021 at 08:42, <rstander@exa.co.za> wrote:
> Running delete from table1 where id = 48938 the trigger for constraint runs for 20 seconds
>
> Event when doing a simple select from table2 where table1_id = 48938 takes about 8 seconds

Does EXPLAIN show it uses a seq scan for this 8-second SELECT?

If so, does it use the index if you SET enable_seqscan TO off; ? If
so, how do the costs compare to the seqscan costs?

Is random_page_cost set to something sane? Are all the indexes valid?
(psql's \d table2 would show you INVALID if they're not.)

does: SHOW enable_indexscan; show that index scanning is switched on?

David



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

Предыдущее
От:
Дата:
Сообщение: Index and statistics not used
Следующее
От: Nagaraj Raj
Дата:
Сообщение: Partition with check constraint with "like"