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_synopsis_set_id)
(map (match-lambda*
(((home-page
location
package-description-data
package-synopsis-data)
license-set-id)
(list (if (string? home-page)
home-page
NULL)
(location->location-id
conn
location)
license-set-id
(package-description-data->package-description-set-id
conn
package-description-data)
(package-synopsis-data->package-synopsis-set-id
conn
package-synopsis-data))))
package-metadata
license-set-ids)
(zip
(map (match-lambda
((home-page rest ...)
(if (string? home-page)
home-page
NULL)))
package-metadata)
(with-time-logging "preparing location ids"
(map (match-lambda
((_ location rest ...)
(location->location-id
conn
location)))
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
conn
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
conn
package-synopsis-data)))
package-metadata)))
;; There can be duplicated entires in package-metadata, for example where
;; you have one package definition which interits from another, and just
;; overrides the version and the source, the package_metadata entries for