How can I apply a functional based index to multiple situations?
I am trying to use Oracle's function based indexes (as opposed to a virtual column with a normal index) to simulate a unique constraint on a subset of data: orders |- id |- FK(customer_id) |- start_ts |- end_ts |- <misc data> CREATE UNIQUE INDEX unique_active_order ON orders CASE end_ts IS NULL THEN customer_id END to ensure there is at most one active/open order per customer. That works but the documentation states that queries must match the condition exactly, even down the THEN clause (because THEN is what gets stored in the index). However, with another table: Task |- id |- FK(order_id) |-
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.