mirror of
https://ids-dev.idsbuybuybuy.com/ids-ecommerce/ids-svc-product.git
synced 2026-11-29 16:57:41 +08:00
feat: add index for active product categories by parent and name
This commit is contained in:
parent
6f6887f0d2
commit
9567b967b2
@ -426,7 +426,8 @@ CREATE TABLE IF NOT EXISTS product.product_category (
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
deleted_at TIMESTAMPTZ
|
||||
);
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS uq_product_category_active_parent_name
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_product_category_active_parent_name
|
||||
ON product.product_category (COALESCE(parent_id, 0), lower(btrim(name))) WHERE deleted_at IS NULL;
|
||||
CREATE INDEX IF NOT EXISTS idx_product_category_active_parent_priority
|
||||
ON product.product_category (parent_id, priority, id) WHERE deleted_at IS NULL;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user