Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
hobs
on Aug 13, 2022
|
parent
|
context
|
favorite
| on:
Improving Postgres text search speed
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 )
nfcampos
on Aug 13, 2022
[–]
Yes although in this specific case you’d lose the order of the results with exists
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
select * from query1 as q where exists ( select * from query2 as q2 where q.col = q2.col )