summaryrefslogtreecommitdiff
path: root/util/updates/update_wip_lists.sql
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-12-16 16:48:12 +0100
committerYorhel <git@yorhel.nl>2019-12-16 16:48:14 +0100
commit939108b4b971edcaf9c70728816fac7676034cda (patch)
tree19c228b854be0c39cdbab634e094df521b4aac0a /util/updates/update_wip_lists.sql
parent153d6578e4c1973f08694fe78259417912e3d5f3 (diff)
ulist: Convert vn.c_* vote stat updating to use ulist_vns table
It turned out that naively changing the existing queries to refer to ulist_vns with a (WHERE vote IS NOT NULL) made them ultra slow (like, DNF-slow), for a reason I haven't been able to figure out yet. I had to rewrite the queries to use CTEs and in doing so figured that I could get an extra performance improvement by combining the popularity and rating updates in one query. The combined update function now runs faster than the old queries.
Diffstat (limited to 'util/updates/update_wip_lists.sql')
-rw-r--r--util/updates/update_wip_lists.sql2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/updates/update_wip_lists.sql b/util/updates/update_wip_lists.sql
index 1bbf700f..e6f37184 100644
--- a/util/updates/update_wip_lists.sql
+++ b/util/updates/update_wip_lists.sql
@@ -113,6 +113,8 @@ COMMIT;
\timing
+DROP FUNCTION update_vnpopularity();
+
\i util/sql/func.sql
CREATE TRIGGER ulist_labels_create AFTER INSERT ON users FOR EACH ROW EXECUTE PROCEDURE ulist_labels_create();