Y
Hacker News
new
|
ask
|
show
|
jobs
by
latch
1960 days ago
Another benefit of partial indexes is to limit a unique constraint:
create index users_email on users(email) where status != 'delete'
1 comments
SomeHacker44
1960 days ago
Be very careful, then, as the optimizer will (usually?) not use the index if the condition is not part if the query.
link
jackTheMan
1960 days ago
you can create views for that, then it will be always part of the query.
link