Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
SigmundA
on Feb 3, 2020
|
parent
|
context
|
favorite
| on:
Null Values in SQL Queries
Normally can't use an index as every value has to be coalesced before comparison.
utborin
on Feb 4, 2020
[–]
You can index the results of functions (or other expressions) in at least some databases. PostgreSQL can do this, for example.
CREATE INDEX idx ON tbl (coalesce(col, ''))
Combining this with UNIQUE can make for some neat tricks.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: