Christopher Baines writes: > The approach I'd recommend is, make yourself a realistic > temp_package_metadata table by populating it with all the > package_metadata entries for a single revision already in your local > database. Then construct and try the slow query, and see how long it > takes, and look at the query plan (run the query with EXPLAIN at the > start). Following up on your question on IRC about creating the temporary table, the code that does this is here [1]. I wouldn't suggest running the code, just the same SQL it uses, and use relevant values for temp-table-name and table-name that are appropriate for the package_metadata table. 1: https://git.savannah.gnu.org/cgit/guix/data-service.git/tree/guix-data-service/model/utils.scm#n313