Split and instrument parts of inferior-packages->package-metadata-ids

As parts of it are slow.
This commit is contained in:
Christopher Baines 2024-01-18 14:42:48 +00:00
parent e51f87cc7e
commit 6842a432d6

View file

@ -400,28 +400,35 @@ WHERE packages.id IN (
package_description_set_id package_description_set_id
package_synopsis_set_id) package_synopsis_set_id)
(map (match-lambda* (zip
(((home-page (map (match-lambda
location ((home-page rest ...)
package-description-data (if (string? home-page)
package-synopsis-data)
license-set-id)
(list (if (string? home-page)
home-page home-page
NULL) NULL)))
package-metadata)
(with-time-logging "preparing location ids"
(map (match-lambda
((_ location rest ...)
(location->location-id (location->location-id
conn conn
location) location)))
license-set-id package-metadata))
license-set-ids
(with-time-logging "preparing package description set ids"
(map (match-lambda
((_ _ package-description-data _)
(package-description-data->package-description-set-id (package-description-data->package-description-set-id
conn conn
package-description-data) package-description-data)))
package-metadata))
(with-time-logging "preparing package synopsis set ids"
(map (match-lambda
((_ _ _ package-synopsis-data)
(package-synopsis-data->package-synopsis-set-id (package-synopsis-data->package-synopsis-set-id
conn conn
package-synopsis-data)))) package-synopsis-data)))
package-metadata package-metadata)))
license-set-ids)
;; There can be duplicated entires in package-metadata, for example where ;; There can be duplicated entires in package-metadata, for example where
;; you have one package definition which interits from another, and just ;; you have one package definition which interits from another, and just
;; overrides the version and the source, the package_metadata entries for ;; overrides the version and the source, the package_metadata entries for