Files
docker-compose-projects/db/80_indexes.sql
2026-02-23 16:40:06 +03:00

8 lines
520 B
SQL

CREATE INDEX IF NOT EXISTS idx_products_name_trgm ON products USING GIN (name gin_trgm_ops);
CREATE INDEX IF NOT EXISTS idx_products_category_id ON products (category_id);
CREATE INDEX IF NOT EXISTS idx_products_brand_id ON products (brand_id);
CREATE INDEX IF NOT EXISTS idx_products_is_active ON products (is_active);
CREATE INDEX IF NOT EXISTS idx_product_attributes_product_key ON product_attributes (product_id, key);
CREATE INDEX IF NOT EXISTS idx_product_attributes_key_value ON product_attributes (key, value);