gallium: add an index argument to create_query