Re: Optimizing `WHERE x IN` query

2019-07-11 Thread Omar Roth
> 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

Re: Optimizing `WHERE x IN` query

2019-07-09 Thread Omar Roth
The suggested query indeed appears to be faster. Thank you. > Did you try if a properly normalized model performs better? I've tested the below schema, which doesn't appear to perform much better but has a couple other advantages for my application: ``` create table subscriptions ( email te

Optimizing `WHERE x IN` query

2019-07-07 Thread Omar Roth
Hi! I am attempting to replicate YouTube's subscription feed. Each user has a list of channel IDs (as text[]) that they are subscribed to. The `users` table looks like: ``` =# \d users Table "public.users" Column | Type | Collation |