Skip to content
Snippets Groups Projects

GIN index uses to find posts by tag

Merged Marcin requested to merge mi_gin_posts_tags into develop
1 unresolved thread
9 files
+ 70
126
Compare changes
  • Side-by-side
  • Inline
Files
9
  • c211dbb9
    GIN index uses to find posts by tag · c211dbb9
    Marcin authored
    -remove hive_post_tags table
    -extend hive_posts for a column with an arrays of tags id
    -tags are added next after a post, not in paralles as it was previously
    -fix bug with not removing tags for a post whose author removed tags
    during edition
@@ -213,6 +213,15 @@ IF NOT EXISTS (SELECT data_type FROM information_schema.columns
ELSE
RAISE NOTICE 'SKIPPING hive_posts upgrade - adding total_votes and net_votes columns';
END IF;
IF NOT EXISTS(SELECT data_type FROM information_schema.columns
WHERE table_name = 'hive_posts' AND column_name = 'tags_ids') THEN
ALTER TABLE ONLY hive_posts
ADD COLUMN tags_ids INTEGER[];
ELSE
RAISE NOTICE 'SKIPPING hive_posts upgrade - adding a tags_ids column';
END IF;
END
$BODY$
@@ -383,3 +392,6 @@ DROP INDEX IF EXISTS hive_posts_promoted_idx;
CREATE INDEX IF NOT EXISTS hive_posts_promoted_id_idx ON hive_posts (promoted, id)
WHERE NOT is_paidout AND counter_deleted = 0
;
CREATE INDEX IF NOT EXISTS hive_posts_tags_ids_idx ON hive_posts USING gin(tags_id gin__int_ops);
Loading