Re: UUID v1 optimizations...

2019-07-07 Thread Peter Geoghegan
Please don't top post -- trim the your response down so that only still-relevant text remains. On Tue, Jun 11, 2019 at 1:27 PM Ancoron Luciferis wrote: > Primary key indexes after an ANALYZE: > table_name | bloat | index_mb | table_mb > ---++--

Re: Custom opclass for column statistics?

2019-07-07 Thread Tom Lane
Ancoron Luciferis writes: > I've been wondering whether it is possible somehow to have the standard > column statistics to respect a certain operator class? In principle, pg_statistic can represent stats for a non-default opclass. Teaching ANALYZE to collect such stats when appropriate, and then

Re: Optimizing `WHERE x IN` query

2019-07-07 Thread Thomas Kellerer
Omar Roth schrieb am 07.07.2019 um 15:43: Currently, the query I'm using to generate a user's feed is: ``` SELECT * FROM channel_videos WHERE ucid IN (SELECT unnest(subscriptions) FROM users WHERE email = $1) ORDER BY published DESC; ``` You could try an EXISTS query without unnest: select cv

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 |