BUG #18607: UNION ALL discards all foreign key relations + indexes

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #18607: UNION ALL discards all foreign key relations + indexes
Дата
Msg-id 18607-651aa996c1e71d48@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #18607: UNION ALL discards all foreign key relations + indexes
Re: BUG #18607: UNION ALL discards all foreign key relations + indexes
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18607
Logged by:          Sanskar Agrawal
Email address:      sanskar@flintk12.com
PostgreSQL version: 15.0
Operating system:   MacOS
Description:

Min Reproducable env :

Consider the query below -> 

"
CREATE OR REPLACE VIEW v3.temp_view AS
SELECT * FROM users WHERE id = 'e-1'
UNION ALL
SELECT * FROM users WHERE id = 'e-2';
"

groups.id is a primary key and has a unique index defined on the same.

Either way when the view is created, the indexes and the related relations
of the foreign key references are being dropped. 
(Same with "UNION").

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!


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