I have big data where I only select a small interval of data at a time such that the selection is always in a sequence. I am trying to implement PostgreSQL like Partial index in MySQL which is targeted for such purposes. I am not sure if the partial unique constraint is the same as the one which I want.
Code in PostgreSQL 9.4
CREATE UNIQUE INDEX dir_events
ON events (measurement_id)
USING btree
(eventBody)
WHERE is_active;
Attempt on ypercube's partial index in MySQL
CREATE UNIQUE INDEX dir_events
[index_type] -- TODO what here?
ON events (measurement_id, is_active)
[index_type] -- TODO what here?
How can you create PostgreSQL-like partial index in MySQL 5.5 or similar?
is_active = TRUE
(or has just one column, the PK ofdir_events
).