- F0 blindaje: Redis/Celery, pg_hba sin trust LAN, secretos a env 600, backups, webhook auth, jobs muertos - F1 caja: bugs POS, reembolsos al corte, apartados, CFDI, topes de descuento en cotizacion/apartado - F2/F7 IA de catalogo: autocategorizacion, dedup de SKUs con embeddings, OCR de facturas, descripciones, claves SAT, limpieza de fitment - F3 IA en el flujo: vision Yonke, preguntas MeLi, venta cruzada, anomalias, sinonimos, busqueda semantica (rerank/embeddings) - F4/F8 escala y cartera: /metrics+Prometheus+Grafana, pool, score de credito, churn, metricas multi-tenant - Nexus Yonke (M1-M6): modelo de datos 1-de-1, alta por donador, vitrina publica, MeLi usado, consignacion, garantia por dias, reportes, etiquetas - Marketplace B2B entre yonkes (catalogo + pedidos cross-tenant) - Seguridad: auth en /api/admin/* (35 endpoints), alertas por tenant - Migraciones v4.27/v4.28; timers expire-demos y rollup-metrics
19 lines
661 B
SQL
19 lines
661 B
SQL
-- v4.24: pg_trgm search indexes for fast fuzzy inventory search.
|
|
-- The POS list endpoint uses ILIKE '%q%' on part_number/name/barcode/aliases;
|
|
-- btree indexes cannot serve those. Trigram GIN indexes make them fast even
|
|
-- with 150k+ SKU catalogs.
|
|
|
|
CREATE EXTENSION IF NOT EXISTS pg_trgm;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_inventory_part_trgm
|
|
ON inventory USING gin (part_number gin_trgm_ops);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_inventory_name_trgm
|
|
ON inventory USING gin (name gin_trgm_ops);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_inventory_alias_trgm
|
|
ON inventory_sku_aliases USING gin (sku gin_trgm_ops);
|
|
|
|
ANALYZE inventory;
|
|
ANALYZE inventory_sku_aliases;
|