diff options
Diffstat (limited to 'sources/db/post_indexes.sql')
-rw-r--r-- | sources/db/post_indexes.sql | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sources/db/post_indexes.sql b/sources/db/post_indexes.sql new file mode 100644 index 0000000..768b7f3 --- /dev/null +++ b/sources/db/post_indexes.sql @@ -0,0 +1,31 @@ +-- +-- Taginfo source: Database +-- +-- post_indexes.sql +-- + +.bail ON + +PRAGMA journal_mode = OFF; +PRAGMA synchronous = OFF; +PRAGMA count_changes = OFF; +PRAGMA temp_store = MEMORY; +PRAGMA cache_size = 5000000; + +-- ============================================================================ + +CREATE UNIQUE INDEX keys_key_idx ON keys (key); +CREATE INDEX tags_key_idx ON tags (key); +-- CREATE UNIQUE INDEX tags_key_value_idx ON tags (key, value); +CREATE INDEX key_combinations_key1_idx ON key_combinations (key1); +CREATE INDEX key_combinations_key2_idx ON key_combinations (key2); +CREATE UNIQUE INDEX key_distributions_key_idx ON key_distributions (key, object_type); + +CREATE UNIQUE INDEX tag_distributions_key_value_idx ON tag_distributions (key, value, object_type); + +CREATE INDEX tag_combinations_key1_value1_idx ON tag_combinations (key1, value1); +CREATE INDEX tag_combinations_key2_value2_idx ON tag_combinations (key2, value2); + +CREATE UNIQUE INDEX relation_types_rtype_idx ON relation_types (rtype); +CREATE INDEX relation_roles_rtype_idx ON relation_roles (rtype); + |