Composite primary key and query on arbitrary fields