Skip to content

Comment on Improving Postgres text search speedparent

Comments

If you dont need the output of the first query you'll almost always have the best performance in sql using exists syntax eg

select * from query1 as q where exists ( select * from query2 as q2 where q.col = q2.col )

Yes although in this specific case you’d lose the order of the results with exists

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.