Rick Otten writes:
> I was able to reproduce a similar issue with using `= ANY(VALUES)` instead
> of `= ANY(ARRAY)`:
>
> 1. fast query using =ANY(ARRAY): https://explain.depesz.com/s/dwP8
> 2. slow query using =ANY(ARRAY(expr)): https://explain.depesz.com/s/3hGb
> 3. slow query using
I was able to reproduce a similar issue with using `= ANY(VALUES)`
> instead of `= ANY(ARRAY)`:
>
> 1. fast query using =ANY(ARRAY): https://explain.depesz.com/s/dwP8
> 2. slow query using =ANY(ARRAY(expr)): https://explain.depesz.com/s/3hGb
> 3. slow query using =ANY(VALUES):
Okay, increasing the collection of statistics seems to have helped. I used
`ALTER TABLE report ALTER COLUMN reporter_id SET STATISTICS 1` and now
queries which previously didn't finish at all now finish in < 1 ms.
The following gave me the hint:
“The amount of information stored in
Hello!
I have been struggling with finding a proper solution for this query for
some time and wanted to ask if someone here knows how to approach this?
I have a table named "report" which has an index on report.reporter_id.
This column consists of IDs which are grouped together using a table