diff options
author | Yorhel <git@yorhel.nl> | 2019-10-07 09:13:40 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-10-07 11:00:48 +0200 |
commit | ba02e35cea8f2f25ab0ed1a4fccc8983435f9671 (patch) | |
tree | 729c14b601ec2a8b779950d531449eff4e6ff434 /util/sql/schema.sql | |
parent | 69ffbc08f489770863b80998c704c66f148e469e (diff) |
SQL: Adjust tag_vn_inherit and trait_chars calculations
Most importantly, downvoted parent tags are now still included for
searching as per https://vndb.org/t12750 - in particular, a downvoted
tag is considered to be exactly the same thing as a tag with no votes at
all.
Also made a few other adjustments:
- Removed the "ignore child tags/traits if parent has its own value"
rule. This was done because the 'spoiler' rating would get
inherited using the average, but that should just have been the
minimum (i.e. if a single child tag is not a spoiler, then neither is
the parent). https://vndb.org/t10082
- The score of a parent tag is now avg(avg(votes_on_child_tags)) rather
than avg(votes_on_child_tags), i.e. tags with more votes don't have
more weight than tags with fewer votes. I don't think vote counts
really matter in determining the parent score.
- Deleted VNs now don't count towards tag statistics (this is consistent
with traits).
- Performance improvements: Smaller indices and more clever querying.
Diffstat (limited to 'util/sql/schema.sql')
-rw-r--r-- | util/sql/schema.sql | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/util/sql/schema.sql b/util/sql/schema.sql index 46bf3d27..7db233d1 100644 --- a/util/sql/schema.sql +++ b/util/sql/schema.sql @@ -610,7 +610,6 @@ CREATE TABLE tags_vn ( CREATE TABLE tags_vn_inherit ( tag integer NOT NULL, vid integer NOT NULL, - users integer NOT NULL, rating real NOT NULL, spoiler smallint NOT NULL ); @@ -689,8 +688,7 @@ CREATE TABLE traits ( CREATE TABLE traits_chars ( cid integer NOT NULL, -- chars (id) tid integer NOT NULL, -- traits (id) - spoil smallint NOT NULL DEFAULT 0, - PRIMARY KEY(cid, tid) + spoil smallint NOT NULL DEFAULT 0 ); -- traits_parents |