Re: Optimizing `WHERE x IN` query - Mailing list pgsql-performance

From Omar Roth
Subject Re: Optimizing `WHERE x IN` query
Date
Msg-id DM5PR18MB105110A24BA55ACD72894026DFF30@DM5PR18MB1051.namprd18.prod.outlook.com
Whole thread Raw
In response to Re: Optimizing `WHERE x IN` query  (Nicolas Charles <nicolas.charles@rudder.io>)
Responses Re: Optimizing `WHERE x IN` query
List pgsql-performance
> We had big performance issues with queries like that, and we modified
> them to use && (see
> https://www.postgresql.org/docs/current/functions-array.html ),
> resulting in a big perf boost

Much appreciated! Unfortunately I'm having trouble turning your suggestions
into a working query.

`cv.ucid && u.subscriptions`  doesn't appear to work in my case since the
comparison is `text && text[]`. Something like:

```
explain (analyze, buffers) select cv.* from channel_videos cv inner join
(select subscriptions from users where email = $1) as u on array[cv.ucid] &&
u.subscriptions;
```

does work but unfortunately doesn't appear to be faster than the current
query.

Cheers





pgsql-performance by date:

Previous
From: Ancoron Luciferis
Date:
Subject: Re: Custom opclass for column statistics?
Next
From: Michael Lewis
Date:
Subject: Re: Optimizing `WHERE x IN` query