Re: BUG #14107: Major query planner bug regarding subqueries and indices - Mailing list pgsql-bugs

From Mathias Kunter
Subject Re: BUG #14107: Major query planner bug regarding subqueries and indices
Date
Msg-id cf9b0435-1ddf-fd58-e899-ddfd7d518c9e@gmail.com
Whole thread Raw
In response to Re: BUG #14107: Major query planner bug regarding subqueries and indices  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-bugs
> How do you find the ANY(ARRAY(...)) version performs with say 10
> million records in the array?

I've tested with a subquery which returns about 20 million different
rows. In this case IN(...) is about 5 times faster than ANY(ARRAY(...))
for me. The exact numbers are:

IN(...):           about 22 seconds
ANY(ARRAY(...)):   about 115 seconds

However, estimated query costs seem to be always correct. So shouldn't
it be quite easy for the planner to create query plans for both the
ANY(ARRAY(...)) and the IN(...) version and then just use the plan where
costs are cheaper?

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #14132: ON CONFLICT not inferring unique index with bigints
Next
From: yjh0502@gmail.com
Date:
Subject: BUG #14134: segmentation fault with large table with gist index