Re: [HACKERS] GSoC 2017: Foreign Key Arrays

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Mark Rofail <markm(dot)rofail(at)gmail(dot)com>
Cc: Joel Jacobson <joel(at)compiler(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, Andreas Karlsson <andreas(at)proxel(dot)se>, Hans-Jürgen Schönig <hs(at)cybertec(dot)at>, Erik Rijkers <er(at)xs4all(dot)nl>, Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zhihong Yu <zyu(at)yugabyte(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] GSoC 2017: Foreign Key Arrays
Date: 2021-03-03 22:10:50
Message-ID: 20210303221050.GJ29832@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 03, 2021 at 11:31:49PM +0200, Mark Rofail wrote:
> This is just a rebase patch since the patch is no longer applicable to the
> current master.

It doesn't just rebase: it also removes the test which was failing on windows
CI:

--- Try using the indexable operator
-SELECT * FROM FKTABLEFORARRAYGIN WHERE ftest1 @>> 5;

> Changelog:
> - v6 (compatible with current master 2020-3-3,
> commit 3769e11a31831fc2f3bd4c4a24b4f45c352fb8fb)
> * rebase to current master

I think the SELECT, when it works, is actually doing a seq scan and not using
the index. On my PC, the index scan is used until an autovacuum/analyze run,
after which it uses seqscan. I'm not sure how the other CIs all managed to run
autovacuum between creating a table and running a query on it, though.

I guess you should first run the query with "explain (costs off)" to show what
plan it's using, and add things like "SET enable_seqscan=off" as needed to
guarantee that everyone will use the same plan, regardless of minor cost
differences and vacuum timing.

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-03-03 22:19:54 Re: Fix DROP TABLESPACE on Windows with ProcSignalBarrier?
Previous Message Vik Fearing 2021-03-03 22:03:46 Re: TRIM_ARRAY