Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
trts
6y ago
0 comments
Save
Share
where coalesce(a, '') = coalesce(b, '')
0 comments
2 comments · 1 top-level
top
newest
oldest
SigmundA
6y ago
· 1 in thread
Normally can't use an index as every value has to be coalesced before comparison.
danaliv
6y ago
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.
j
/
k
navigate · click thread line to collapse