SQLite Forum

Query shape to get plan with SeekGE on a composite key
Login
Use a vector comparison in the WHERE clause:

> ~~~
SELECT KeyPart1, hex(KeyPart2), KeyPart3, KeyPart4 
  FROM Test 
 WHERE (KeyPart1,KeyPart2,KeyPart3,KeyPart4) > (1,x'abcdef',2,3)
 ORDER BY KeyPart1, KeyPart2, KeyPart3, KeyPart4
 LIMIT 1;
~~~