summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2022-08-03 13:46:32 +0200
committerYorhel <git@yorhel.nl>2022-08-03 13:46:33 +0200
commitf13f03ac6700e0364344b8543842d68d697f2032 (patch)
tree2366d490c5288fb4dd5354b7b0010d46e1a1318d /util
parent625e42d62d9334330cb7a75c78f5de8d7cf256e1 (diff)
Add tags_vn_direct cache table
This speeds up VN pages a little bit, but the main reason for this table is to implement no-parent-inherit tag search. Because the rows in tags_vn_direct represent an intermediate calculation for tags_vn_inherit, generating and updating these caches isn't all that much slower with this change. I'm not a fan of the DELETE & re-INSERT approach on individual-VN updates, though, as that tends to cause unnecessary (index) writes. Not sure how complex a more incremental update is to implement, but it sounds painful. :/
Diffstat (limited to 'util')
-rw-r--r--util/updates/2022-08-03-tags_vn_direct.sql10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/updates/2022-08-03-tags_vn_direct.sql b/util/updates/2022-08-03-tags_vn_direct.sql
new file mode 100644
index 00000000..e8a2445c
--- /dev/null
+++ b/util/updates/2022-08-03-tags_vn_direct.sql
@@ -0,0 +1,10 @@
+CREATE TABLE tags_vn_direct (
+ tag vndbid NOT NULL,
+ vid vndbid NOT NULL,
+ rating real NOT NULL,
+ spoiler smallint NOT NULL,
+ lie boolean NOT NULL
+);
+\i sql/func.sql
+\i sql/perms.sql
+SELECT tag_vn_calc(NULL);