Re: Weird seqscan node plan - Mailing list pgsql-general

From Andrei Zhidenkov
Subject Re: Weird seqscan node plan
Date
Msg-id DA490E2B-49FB-4AE4-9134-28CC3157F2B2@n26.com
Whole thread Raw
In response to Weird seqscan node plan  (Игорь Выскорко <vyskorko.igor@yandex.ru>)
List pgsql-general
How many tables do you have in your query? If too many, in your case “Genetic Query Optiomiation” might be used (https://www.postgresql.org/docs/10/geqo-pg-intro.html).

On 26. Nov 2019, at 03:19, Игорь Выскорко <vyskorko.igor@yandex.ru> wrote:

Hi all!
I'm confused by planner choice: seqscan but not index scan when index scan cost is much cheaper.
1st plan: https://explain.depesz.com/s/Cti#l8
2nd plan (with "set enable_seqscan = off"): https://explain.depesz.com/s/qn0I#l8

Look at 8th row: this nested loop decided to join the second node by using seqscan (1st plan) when index is available (2nd plan). Index scan is much cheaper (0.430 over 257.760).

What am I missing?

And thanks for any reply!



pgsql-general by date:

Previous
From: Игорь Выскорко
Date:
Subject: Weird seqscan node plan
Next
From: stan
Date:
Subject: pgmodeler an server V12