I am using a MySQL DB, and have the following table:
CREATE TABLE SomeTable ( PrimaryKeyCol BIGINT(20) NOT NULL, A BIGINT(20) NOT NULL, FirstX INT(11) N
You need to add another index on LastX.
The unique index FirstLastXPriority_Index (FirstX,LastX,P) represents the concatenation of these values, so it will be useless with the 'AND LastX >= ?' part of your WHERE clause.