Re: Weird seqscan node plan

From: Игорь Выскорко <vyskorko(dot)igor(at)yandex(dot)ru>
To: Andrei Zhidenkov <andrei(dot)zhidenkov(at)n26(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Weird seqscan node plan
Date: 2019-11-26 09:12:50
Message-ID: 31839331574759570@vla5-5336eea6ea62.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<div> </div><div> </div><div>26.11.2019, 16:02, "Andrei Zhidenkov" &lt;andrei(dot)zhidenkov(at)n26(dot)com&gt;:</div><blockquote><div style="word-wrap:break-word">How many tables do you have in your query? If too many, in your case “Genetic Query Optiomiation” might be used (<a href="https://www.postgresql.org/docs/10/geqo-pg-intro.html">https://www.postgresql.org/docs/10/geqo-pg-intro.html</a>).<div> <blockquote><div>On 26. Nov 2019, at 03:19, Игорь Выскорко &lt;<a href="mailto:vyskorko(dot)igor(at)yandex(dot)ru">vyskorko(dot)igor(at)yandex(dot)ru</a>&gt; wrote:</div> <div><div>Hi all!<br />I'm confused by planner choice: seqscan but not index scan when index scan cost is much cheaper.<br />1st plan: <a href="https://explain.depesz.com/s/Cti#l8">https://explain.depesz.com/s/Cti#l8</a><br />2nd plan (with "set enable_seqscan = off"): <a href="https://explain.depesz.com/s/qn0I#l8">https://explain.depesz.com/s/qn0I#l8</a><br /><br />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).<br /><br />What am I missing?<br /><br />And thanks for any reply!<br /> </div></div></blockquote></div></div></blockquote><div> </div><div>Hm... about 12 tables.<br />I tried to disable geqo (set geqo = off;)  plan didn't change. But thanks for your try )<br /><br />Version I'm using (if matter):<br />select version();</div><div>PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit</div>

Attachment Content-Type Size
unknown_filename text/html 1.5 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message stan 2019-11-26 11:33:11 pgmodeler an server V12
Previous Message Andrei Zhidenkov 2019-11-26 09:02:44 Re: Weird seqscan node plan