Re: Strange execution plan
От | Manuel Weitzman |
---|---|
Тема | Re: Strange execution plan |
Дата | |
Msg-id | EE6D94D6-2F72-4B51-9ACE-750230596A54@gmail.com обсуждение исходный текст |
Ответ на | Re: Strange execution plan (Manuel Weitzman <manuelweitzman@gmail.com>) |
Список | pgsql-performance |
> On 08-07-2021, at 17:13, Manuel Weitzman <manuelweitzman@gmail.com> wrote: > > Option A: Use a common table expression to "force" the usage of > test_json_data_idx > > WITH json_matching_rows AS ( > SELECT t.* > FROM test ti > WHERE t.json_data @> '{"book":{"title":"In Search of Lost Time"}}' > ) > SELECT t.* > FROM json_matching_rows t > WHERE t."existe" IS true > ORDER BY t."id" DESC > LIMIT 100 OFFSET 0; > The first query line should be WITH MATERIALIZED json_matching_rows AS ( I had forgotten that Postgres 12 removed the optimization barrier on common table expressions. To introduce it again the MATERIALIZED clause is needed. Apparently I need to work on reviewing my emails properly before sending them. Best regards, Manuel Weitzman
В списке pgsql-performance по дате отправления: