manned/indexer
Yorhel 1ee5c9c2df SQL: Add packages.c_hasman cache to speed up package listings
Going from average ~100ms to ~10ms or so. The previous query had a
tendency to be much slower sometimes, let's see if this cache also takes
care of those outliers.

Migration script:

  ALTER TABLE packages ADD COLUMN c_hasman boolean NOT NULL DEFAULT FALSE;

  DROP INDEX packages_system_name_key;
  CREATE UNIQUE INDEX packages_system_name_key ON packages (system, name) INCLUDE (id, c_hasman, dead);

  UPDATE packages SET c_hasman = NOT c_hasman
   WHERE c_hasman <> EXISTS(SELECT 1 FROM package_versions pv WHERE pv.package = packages.id AND EXISTS(SELECT 1 FROM files f WHERE f.pkgver = pv.id));
2024-04-29 21:15:40 +02:00
..
src SQL: Add packages.c_hasman cache to speed up package listings 2024-04-29 21:15:40 +02:00
tests indexer: Fix link resolution and hardlink handling for rpm 2017-01-18 13:07:42 +01:00
Cargo.lock indexer: More crate updates + warning fixes + 2018 edition 2021-12-11 14:56:22 +01:00
Cargo.toml indexer: More crate updates + warning fixes + 2018 edition 2021-12-11 14:56:22 +01:00