Y
Hacker News
new
|
ask
|
show
|
jobs
by
latch
2007 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
2006 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
2006 days ago
you can create views for that, then it will be always part of the query.
link