Re: Custom opclass for column statistics?

2019-07-09 Thread Ancoron Luciferis
On 06/07/2019 15:58, Tom Lane wrote: > 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

Re: UUID v1 optimizations...

2019-07-09 Thread Ancoron Luciferis
On 08/07/2019 02:26, Peter Geoghegan wrote: > 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

Re: Optimizing `WHERE x IN` query

2019-07-09 Thread Nicolas Charles
Le 07/07/2019 à 16:33, Thomas Kellerer a écrit : 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

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