Re: =ANY(ARRAY) vs =ANY(ARRAY(expr)) performance

2022-11-14 Thread Guillaume Cottenceau
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

Re: =ANY(ARRAY) vs =ANY(ARRAY(expr)) performance

2022-11-14 Thread Rick Otten
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):

Re: =ANY(ARRAY) vs =ANY(ARRAY(expr)) performance

2022-11-13 Thread Ramdip Gill
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

=ANY(ARRAY) vs =ANY(ARRAY(expr)) performance

2022-11-13 Thread Ramdip Gill
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