From: Tom Lane <tgl@sss.pgh.pa.us>
To: sanskar@flintk12.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18607: UNION ALL discards all foreign key relations + indexes
Date: Mon, 09 Sep 2024 12:29:40 -0400
Message-ID: <3208238.1725899380@sss.pgh.pa.us> (raw)
In-Reply-To: <18607-651aa996c1e71d48@postgresql.org>
References: <18607-651aa996c1e71d48@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> CREATE OR REPLACE VIEW v3.temp_view AS
> SELECT * FROM users WHERE id = 'e-1'
> UNION ALL
> SELECT * FROM users WHERE id = 'e-2';
> Either way when the view is created, the indexes and the related relations
> of the foreign key references are being dropped.
Views do not have either indexes or foreign keys.
> What + Why? I am processing the result of the union in another CTE which now
> is not having access to indices and so it is performing a seq scan!
This seems to be a performance complaint, rather than a valid bug
report. You might find it helpful to read
https://wiki.postgresql.org/wiki/Slow_Query_Questions
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, sanskar@flintk12.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18607: UNION ALL discards all foreign key relations + indexes
In-Reply-To: <3208238.1725899380@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox