154a_account_spark_shadow_indexes_notx.sql 358 B

123456
  1. CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_accounts_parent_account_id
  2. ON accounts (parent_account_id) WHERE parent_account_id IS NOT NULL;
  3. CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS uq_accounts_spark_shadow_per_parent
  4. ON accounts (parent_account_id)
  5. WHERE parent_account_id IS NOT NULL AND quota_dimension = 'spark' AND deleted_at IS NULL;