Some of the tricks we used to speed up SELECT-s in PostgreSQL: LEFT JOIN with redundant conditions, VALUES, extended statistics, primary key type conversion, CLUSTER, pg_hint_plan + bonus — There are numerous posts about PostgreSQL optimization: the rabbit hole is deep. When I began coding the analytics backend several years ago, I already had experience with other DBs such as MySQL and SQL Server. Still, I never had to focus on the performance so much. The previous projects I…