Re: Optimizing `WHERE x IN` query

Omar Roth <[email protected]>
Newsgroups gmane.comp.db.postgresql.performance
Message-ID <DM5PR18MB105110A24BA55ACD72894026DFF30@DM5PR18MB1051.namprd18.prod.outlook.com>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.