PHP Classes

File: SQL File

Recommend this page to a friend!
  Packages of Matthew Asham   Binkterm PHP   database/migrations/v1.11.0.12_trigram_search_indexes.sql   Download  
File: database/migrations/v1.11.0.12_trigram_search_indexes.sql
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Binkterm PHP
Bulletin board system based on the Web
Author: By
Last change:
Date: 5 days ago
Size: 754 bytes
 

Contents

Class file image Download
-- v1.11.0.12 - Add trigram GIN indexes for fast ILIKE search on message text and subject -- Without these, ILIKE '%term%' does a full sequential table scan. -- pg_trgm lets PostgreSQL use a GIN index for arbitrary substring/ILIKE queries. -- Initial index build may take a moment on large tables. CREATE EXTENSION IF NOT EXISTS pg_trgm; CREATE INDEX IF NOT EXISTS idx_echomail_subject_trgm ON echomail USING GIN (subject gin_trgm_ops); CREATE INDEX IF NOT EXISTS idx_echomail_body_trgm ON echomail USING GIN (message_text gin_trgm_ops); CREATE INDEX IF NOT EXISTS idx_netmail_subject_trgm ON netmail USING GIN (subject gin_trgm_ops); CREATE INDEX IF NOT EXISTS idx_netmail_body_trgm ON netmail USING GIN (message_text gin_trgm_ops);