>From this I'm guessing the temp_package_metadata table has only one >row. My understanding is that this table would normally have as many >rows as packages in the revision of Guix being processed. It might not >be possible to reproduce the slowness of the query without more rows. I've inserted one row just as an example. As you've already said, the temp_package_metadata table should have as many rows as package_metadata. After populated the temp_package_metadata with 500 rows of package_metadata, the query takes a long time as we expected. I'm using Flame Graph to visualize the slow paths on the revision part. At first, I choose the slow one that I already know. However, I can't successfully trigger the slow query following the below step: * Run the **guix-data-service-process-job** under guix-data-service/scripts folder as standalone providing an existing revision on my local db. Am I on the right path for adding new jobs log to my local db? In addition, I've successfully generated simple Flame Graph using Linux perf. It visualizes only the data that was captured while I'm browsing on the Guix Data Service Page. Please find the svg file attached. Thanks, Canan Talayhan On Tue, Apr 27, 2021 at 9:26 PM Christopher Baines wrote: > > > Canan Talayhan writes: > > > I am writing to give you an update on the progress that I have made. > > Great :) > > > I've created a temporary table named temp_package_metadata[1] and > > insert a revision that already in my local database[2]. Then as you > > said I've run the slow query with EXPLAIN ANALYZE. (screenshot is > > attached) I may understand the slow query's working logic. > > > > [1]CREATE TEMPORARY TABLE temp_package_metadata (LIKE package_metadata > > INCLUDING ALL) > > > > [2]INSERT INTO temp_package_metadata (home_page, > > location_id,license_set_id,package_description_set_id, > > package_synopsis_set_id) VALUES ('https://zlib.net/',9,9,2373,1407) > > From this I'm guessing the temp_package_metadata table has only one > row. My understanding is that this table would normally have as many > rows as packages in the revision of Guix being processed. It might not > be possible to reproduce the slowness of the query without more rows.