PgHero

Queries

Total Time Average Time Calls
312 min 24% 170 ms 110,298 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
297 min 23% 188 ms 94,966 odoo
SELECT max(id)
               FROM ir_attachment
              WHERE create_uid = $1
                AND url like $2
           GROUP BY datas_fname
           ORDER BY datas_fname
Details
CREATE INDEX CONCURRENTLY ON ir_attachment USING gist (url gist_trgm_ops)
Rows: 1740603
Row progression: 1740603, 6

Row estimates
- url (~~): 6
- create_uid (=): 435151
- datas_fname (sort): 1

Existing indexes
- id PRIMARY
- checksum
- res_model, res_id
- url
208 min 16% 728 ms 17,170 odoo
SELECT "product_price_history".id FROM "product_price_history" WHERE ((("product_price_history"."company_id" = $1)  AND  ("product_price_history"."product_id" = $2))  AND  ("product_price_history"."datetime" < $3)) ORDER BY "product_price_history"."datetime" DESC,"product_price_history"."id" DESC  limit $4
Details
CREATE INDEX CONCURRENTLY ON product_price_history (product_id, datetime)
Rows: 11412050
Row progression: 11412050, 6185, 619

Row estimates
- product_id (=): 6185
- datetime (<): 1141206
- company_id (=): 11412050
- datetime (sort): 6

Existing indexes
- id PRIMARY
116 min 9% 185 ms 37,749 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
48 min 4% 2 ms 1,818,523 odoo
SELECT "mrp_bom".id FROM "mrp_bom" LEFT JOIN "product_product" as "mrp_bom__product_id" ON ("mrp_bom"."product_id" = "mrp_bom__product_id"."id") WHERE ((("mrp_bom"."active" = $1)  AND  (("mrp_bom"."product_id" = $2)  OR  ("mrp_bom"."product_id" IS NULL   AND  ("mrp_bom"."product_tmpl_id" = $3))))  AND  ("mrp_bom"."company_id" = $4)) ORDER BY "mrp_bom"."sequence" ,"mrp_bom__product_id"."default_code" ,"mrp_bom__product_id"."id"   limit $5
48 min 4% 187 ms 15,445 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
26 min 2% 2 ms 764,936 odoo
SELECT count($1) FROM "order_dispatch" WHERE ((("order_dispatch"."retry" IS NULL or "order_dispatch"."retry" = $2 )  AND  ("order_dispatch"."state" = $3))  AND  "order_dispatch"."sync_id" IS NULL )
22 min 2% 156 ms 8,475 odoo
SELECT "mrp_production".id FROM "mrp_production" WHERE ("mrp_production"."product_id" in ($1)) ORDER BY "mrp_production"."date_planned_start" ASC,"mrp_production"."id"
Details
CREATE INDEX CONCURRENTLY ON mrp_production (product_id, date_planned_start)
Rows: 1415785
Row progression: 1415785, 82, 0

Row estimates
- product_id (=): 82
- date_planned_start (sort): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- date_finished
- date_planned_finished
- date_planned_start
- date_start
- name, company_id UNIQUE
18 min 1% 189 ms 5,757 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3,$4)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
16 min 1% 0 ms 52,507,046 odoo
DISCARD ALL
8 min 0.6% 193 ms 2,392 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3,$4,$5)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
7 min 0.5% 652 ms 635 odoo
SELECT count($1) FROM "sale_order" WHERE (("sale_order"."fo_state" not in ($2,$3,$4)) OR "sale_order"."fo_state" IS NULL) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($5)))  AND  (("sale_order"."warehouse_id" in ($6))  OR  ("sale_order"."warehouse_id" in ($7))))
6 min 0.4% 0 ms 26,020,281 odoo
SELECT base_registry_signaling.last_value,
                                  base_cache_signaling.last_value
                           FROM base_registry_signaling, base_cache_signaling
5 min 0.4% 1,939 ms 157 odoo
SELECT res_partner.id
                         FROM "res_partner"
                       WHERE ("res_partner"."active" = $1) AND (("res_partner"."type" != $2)  OR  "res_partner"."type" IS NULL ) AND  (res_partner.email ilike $3
                           OR res_partner.display_name ilike $4
                           OR res_partner.ref ilike $5
                           OR res_partner.vat ilike $6)
                           -- don't panic, trust postgres bitmap
                     ORDER BY res_partner.display_name ilike $7 desc,
                              res_partner.display_name
4 min 0.3% 0 ms 64,201,939 odoo
BEGIN ISOLATION LEVEL REPEATABLE READ
3 min 0.3% 200 ms 978 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3,$4,$5,$6)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
3 min 0.3% 1 ms 166,139 odoo
SELECT "mrp_bom".id FROM "mrp_bom" WHERE ((("mrp_bom"."active" = $1)  AND  "mrp_bom"."product_id" IS NULL )  AND  ("mrp_bom"."product_tmpl_id" = $2)) ORDER BY "mrp_bom"."sequence"   limit $3
Details
CREATE INDEX CONCURRENTLY ON mrp_bom (product_tmpl_id)
Rows: 10996
Row progression: 10996, 1

Row estimates
- product_tmpl_id (=): 1
- active (=): 5498
- product_id (null): 10976
- sequence (sort): 10996

Existing indexes
- id PRIMARY
3 min 0.3% 592 ms 328 odoo
SELECT count($1) FROM "sale_order" WHERE (("sale_order"."warehouse_id" = $2)  AND  (("sale_order"."fo_state" not in ($3,$4,$5)) OR "sale_order"."fo_state" IS NULL)) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($6)))  AND  (("sale_order"."warehouse_id" in ($7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17))  OR  ("sale_order"."warehouse_id" in ($18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28))))
3 min 0.2% 1 ms 186,960 odoo
SELECT "mrp_bom".id FROM "mrp_bom" WHERE (("mrp_bom"."active" = $1)  AND  ("mrp_bom"."product_tmpl_id" in ($2))) ORDER BY "mrp_bom"."sequence"
Details
CREATE INDEX CONCURRENTLY ON mrp_bom (product_tmpl_id)
Rows: 10996
Row progression: 10996, 1

Row estimates
- product_tmpl_id (=): 1
- active (=): 5498
- sequence (sort): 10996

Existing indexes
- id PRIMARY
3 min 0.2% 1 ms 140,604 odoo
INSERT INTO "mail_message" ("id", "model", "reply_to", "body", "no_auto_thread", "message_type", "author_id", "date", "res_id", "parent_id", "message_id", "record_name", "subtype_id", "email_from", "subject", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, (now() at time zone $18), (now() at time zone $19)) RETURNING id
3 min 0.2% 0 ms 10,048,797 odoo
SELECT count($1) FROM "order_dispatch" WHERE ((("order_dispatch"."retry" IS NULL or "order_dispatch"."retry" = $2 )  AND  ("order_dispatch"."state" = $3))  AND  ("order_dispatch"."source" = $4))
2 min 0.2% 1,369 ms 108 odoo
SELECT min("order_dispatch".id) AS id, count("order_dispatch".id) AS "__count" , "order_dispatch"."state" as "state" 
            FROM "order_dispatch"
            WHERE (("order_dispatch"."create_date" >= $1)  AND  ("order_dispatch"."create_date" <= $2))
            GROUP BY "order_dispatch"."state"
            ORDER BY "state"
Details
CREATE INDEX CONCURRENTLY ON order_dispatch (create_date)
Rows: 653422
Row progression: 653422, 65342

Row estimates
- create_date (>=): 65342
- create_date (<=): 65342
- state (sort): 217807

Existing indexes
- id PRIMARY
- edd
- retry
- state
- sync_id
2 min 0.2% 1,351 ms 108 odoo
SELECT min("order_dispatch".id) AS id, count("order_dispatch".id) AS "__count" 
            FROM "order_dispatch"
            WHERE (("order_dispatch"."create_date" >= $1)  AND  ("order_dispatch"."create_date" <= $2))
Details
CREATE INDEX CONCURRENTLY ON order_dispatch (create_date)
Rows: 653422
Row progression: 653422, 65342

Row estimates
- create_date (>=): 65342
- create_date (<=): 65342

Existing indexes
- id PRIMARY
- edd
- retry
- state
- sync_id
2 min 0.2% 0 ms 3,517,850 odoo
SELECT "order_dispatch".id FROM "order_dispatch" WHERE (((("order_dispatch"."retry" IS NULL or "order_dispatch"."retry" = $1 )  AND  ("order_dispatch"."edd" <= $2))  AND  ("order_dispatch"."state" = $3))  AND  "order_dispatch"."sync_id" IS NOT NULL) ORDER BY "order_dispatch"."create_date"   limit $4
2 min 0.2% 1,327 ms 108 odoo
SELECT min("order_dispatch".id) AS id, count("order_dispatch".id) AS "__count" , "order_dispatch"."warehouse_id" as "warehouse_id" 
            FROM "order_dispatch" LEFT JOIN "stock_warehouse" as "order_dispatch__warehouse_id" ON ("order_dispatch"."warehouse_id" = "order_dispatch__warehouse_id"."id")
            WHERE (("order_dispatch"."create_date" >= $1)  AND  ("order_dispatch"."create_date" <= $2))
            GROUP BY "order_dispatch"."warehouse_id","order_dispatch__warehouse_id"."name"
            ORDER BY  "order_dispatch__warehouse_id"."name"
2 min 0.2% 0 ms 11,952,804 odoo
SELECT id FROM "res_users" WHERE id IN ($1)
2 min 0.2% 2 ms 67,265 odoo
INSERT INTO "stock_move" ("id", "company_id", "name", "rule_id", "is_done", "procure_method", "location_dest_id", "scrapped", "product_uom_qty", "priority", "location_id", "to_refund", "ordered_qty", "group_id", "state", "product_id", "date_expected", "warehouse_id", "date", "partner_id", "sale_line_id", "sequence", "additional", "origin", "propagate", "picking_type_id", "product_uom", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, (now() at time zone $30), (now() at time zone $31)) RETURNING id
2 min 0.2% 0 ms 785,599 odoo
SELECT count($1) FROM "order_dispatch" WHERE ((("order_dispatch"."response"::text like $2)  AND  ("order_dispatch"."create_date" > $3))  AND  ("order_dispatch"."state" = $4))
2 min 0.2% 0 ms 7,593,702 odoo
SELECT "order_dispatch".id FROM "order_dispatch" WHERE ((("order_dispatch"."retry" IS NULL or "order_dispatch"."retry" = $1 )  AND  ("order_dispatch"."state" = $2))  AND  ("order_dispatch"."source" = $3)) ORDER BY "order_dispatch"."create_date"   limit $4 offset $5
2 min 0.1% 198 ms 583 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3,$4,$5,$6,$7)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
2 min 0.1% 279 ms 350 odoo
SELECT "product_product".id FROM "product_template" as "product_product__product_tmpl_id","product_product" WHERE ("product_product"."product_tmpl_id"="product_product__product_tmpl_id"."id") AND (("product_product"."active" = $1)  AND  ("product_product__product_tmpl_id"."categ_id" in ($2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17))) ORDER BY "product_product"."default_code" ,"product_product"."id"   limit $18
2 min 0.1% 83 ms 1,162 odoo
SELECT min("sale_report".id) AS id, count("sale_report".id) AS "__count" , sum("sale_report"."price_subtotal") AS "price_subtotal" 
            FROM "sale_report"
            WHERE (("sale_report"."date" <= $1)  AND  ("sale_report"."date" >= $2)) AND ("sale_report"."company_id" IS NULL   OR  ("sale_report"."company_id" in ($3)))
2 min 0.1% 83 ms 1,162 odoo
SELECT min("sale_report".id) AS id, count("sale_report".id) AS "__count" , sum("sale_report"."price_subtotal") AS "price_subtotal" ,"sale_report"."team_id" as "team_id" 
            FROM "sale_report" LEFT JOIN "crm_team" as "sale_report__team_id" ON ("sale_report"."team_id" = "sale_report__team_id"."id") LEFT JOIN 
                (SELECT DISTINCT ON (res_id) res_id, value
                 FROM "ir_translation"
                 WHERE name=$1 AND lang=$2 AND value!=$3
                 ORDER BY res_id, id DESC)
             as "sale_report__team_id__name" ON ("sale_report__team_id"."id" = "sale_report__team_id__name"."res_id")
            WHERE (("sale_report"."date" <= $4)  AND  ("sale_report"."date" >= $5)) AND ("sale_report"."company_id" IS NULL   OR  ("sale_report"."company_id" in ($6)))
            GROUP BY "sale_report"."team_id",COALESCE("sale_report__team_id__name"."value","sale_report__team_id"."name")
            ORDER BY  COALESCE("sale_report__team_id__name"."value", "sale_report__team_id"."name")
2 min 0.1% 78 ms 1,162 odoo
SELECT min("sale_report".id) AS id, count("sale_report".id) AS "__count" , sum("sale_report"."price_subtotal") AS "price_subtotal" ,"sale_report"."warehouse_id" as "warehouse_id" 
            FROM "sale_report" LEFT JOIN "stock_warehouse" as "sale_report__warehouse_id" ON ("sale_report"."warehouse_id" = "sale_report__warehouse_id"."id")
            WHERE (("sale_report"."date" <= $1)  AND  ("sale_report"."date" >= $2)) AND ("sale_report"."company_id" IS NULL   OR  ("sale_report"."company_id" in ($3)))
            GROUP BY "sale_report"."warehouse_id","sale_report__warehouse_id"."name"
            ORDER BY  "sale_report__warehouse_id"."name"
2 min 0.1% 5 ms 16,496 odoo
SELECT "product_product".id FROM "product_product" WHERE (("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
1 min 0.1% 1 ms 67,269 odoo
SELECT "mrp_bom".id FROM "mrp_bom" LEFT JOIN "product_product" as "mrp_bom__product_id" ON ("mrp_bom"."product_id" = "mrp_bom__product_id"."id") WHERE (("mrp_bom"."active" = $1)  AND  (("mrp_bom"."product_id" = $2)  OR  ("mrp_bom"."product_id" IS NULL   AND  ("mrp_bom"."product_tmpl_id" = $3)))) ORDER BY "mrp_bom"."sequence" ,"mrp_bom__product_id"."default_code" ,"mrp_bom__product_id"."id"   limit $4
1 min 0.1% 260 ms 328 odoo
SELECT "sale_order".id FROM "sale_order" WHERE (("sale_order"."warehouse_id" = $1)  AND  (("sale_order"."fo_state" not in ($2,$3,$4)) OR "sale_order"."fo_state" IS NULL)) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($5)))  AND  (("sale_order"."warehouse_id" in ($6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16))  OR  ("sale_order"."warehouse_id" in ($17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27)))) ORDER BY "sale_order"."date_order" DESC,"sale_order"."id" DESC  limit $28
1 min 0.1% 874 ms 92 odoo
SELECT count($1) FROM "sale_order" WHERE (("sale_order"."fo_state" not in ($2,$3,$4)) OR "sale_order"."fo_state" IS NULL) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($5)))  AND  (("sale_order"."warehouse_id" in ($6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16))  OR  ("sale_order"."warehouse_id" in ($17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27))))
1 min 0.1% 93 ms 845 odoo
SELECT "product_product".id FROM "product_template" as "product_product__product_tmpl_id","product_product" WHERE ("product_product"."product_tmpl_id"="product_product__product_tmpl_id"."id") AND ((("product_product"."active" = $1)  AND  ("product_product__product_tmpl_id"."categ_id" in ($2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17)))  AND  ("product_product"."default_code"::text ilike $18)) ORDER BY "product_product"."default_code" ,"product_product"."id"   limit $19
1 min < 0.1% 1,461 ms 51 odoo
SELECT COUNT(DISTINCT partner_id) 
                FROM sale_order
                WHERE is_food_order = $1 AND employee_meal = $2 AND state = $3 AND date_order >= $4 AND date_order <= $5 AND warehouse_id = $6 AND
                partner_id NOT IN (SELECT DISTINCT partner_id FROM sale_order WHERE is_food_order = $7 AND date_order < $8 AND warehouse_id = $9)
1 min < 0.1% 2 ms 33,747 odoo
SELECT "order_dispatch".id FROM "order_dispatch" WHERE ((("order_dispatch"."retry" IS NULL or "order_dispatch"."retry" = $1 )  AND  "order_dispatch"."sync_id" IS NULL )  AND  ("order_dispatch"."state" = $2)) ORDER BY "order_dispatch"."create_date"   limit $3
1 min < 0.1% 0 ms 4,416,767 odoo
SELECT res_id, module, name
            FROM ir_model_data
            WHERE model = $1 AND res_id in ($2)
Details
CREATE INDEX CONCURRENTLY ON ir_model_data (res_id)
Rows: 488450
Row progression: 488450, 1

Row estimates
- res_id (=): 1
- model (=): 9216

Existing indexes
- id PRIMARY
- model, res_id
- module, name UNIQUE
1 min < 0.1% 2 ms 34,138 odoo
SELECT "swk_brand"."id" as "id","swk_brand"."logo" as "logo" FROM "swk_brand" WHERE "swk_brand".id IN ($1)
1 min < 0.1% 781 ms 72 odoo
SELECT min("sale_report".id) AS id, count("sale_report".id) AS "product_id_count" , sum("sale_report"."product_uom_qty") AS "product_uom_qty" ,"sale_report"."product_id" as "product_id" 
            FROM "sale_report" LEFT JOIN "product_product" as "sale_report__product_id" ON ("sale_report"."product_id" = "sale_report__product_id"."id")
            WHERE (("sale_report"."state" in ($1,$2))  AND  ("sale_report"."product_id" in ($3))) AND ("sale_report"."company_id" IS NULL   OR  ("sale_report"."company_id" in ($4)))
            GROUP BY "sale_report"."product_id","sale_report__product_id"."default_code","sale_report__product_id"."id"
            ORDER BY  "sale_report__product_id"."default_code" ,"sale_report__product_id"."id"
1 min < 0.1% 195 ms 277 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
1 min < 0.1% 333 ms 160 odoo
SELECT count($1) FROM "sale_order" WHERE (((("sale_order"."state" in ($2,$3))  AND  ("sale_order"."employee_meal" IS NULL or "sale_order"."employee_meal" = $4 ))  AND  ("sale_order"."warehouse_id" = $5))  AND  ("sale_order"."is_food_order" = $6)) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($7)))  AND  (("sale_order"."warehouse_id" in ($8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24))  OR  ("sale_order"."warehouse_id" in ($25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41))))
1 min < 0.1% 9 ms 5,766 odoo
SELECT "product_product".id FROM "product_product" WHERE ((("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($3)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
1 min < 0.1% 46 ms 1,125 odoo
SELECT "product_product".id FROM "product_product" WHERE (((((((("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($3))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($4))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($5))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($6))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($7))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($8)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
1 min < 0.1% 1 ms 88,140 odoo
UPDATE "ir_attachment" SET "store_fname"=$1,"file_size"=$2,"index_content"=$3,"checksum"=$4,"db_datas"=$5,"write_uid"=$6,"write_date"=(now() at time zone $7) WHERE id IN ($8)
Covered by index on (id)
Rows: 1740603
Row progression: 1740603, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- checksum
- res_model, res_id
- url
1 min < 0.1% 844 ms 59 odoo
SELECT count($1) FROM "sale_order" WHERE (("sale_order"."fo_state" not in ($2,$3,$4)) OR "sale_order"."fo_state" IS NULL) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($5)))  AND  (("sale_order"."warehouse_id" in ($6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22))  OR  ("sale_order"."warehouse_id" in ($23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39))))
1 min < 0.1% 1 ms 33,878 odoo
INSERT INTO "sale_order" ("id", "deliverect_id", "fixed_fee", "commission_percentage", "user_id", "company_id", "name", "deliverect_otp", "vat_percentage", "platform_id", "scheduled_order", "date_order", "picking_policy", "forced_confirmation", "packed", "employee_meal", "warehouse_id", "pickup_time", "food_platform_service_fee", "food_platform_total", "pricelist_id", "jsonrequest", "state", "payment_method", "partner_id", "portfolio_acquisition", "note", "brand_acquisition", "incremental_fee", "access_token", "partner_shipping_id", "team_id", "completed", "partner_invoice_id", "gateway_fee_percentage", "code", "platform_discounted_amount", "is_food_order", "brand_id", "brand_partner_id", "delivery_charge", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, (now() at time zone $44), (now() at time zone $45)) RETURNING id
1 min < 0.1% 0 ms 14,230,279 odoo
SELECT $2 FROM ONLY "public"."res_users" x WHERE "id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x
1 min < 0.1% 277 ms 169 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1)) AND (("swk_suborder"."kitchen_id" in ($2))  OR  ("swk_suborder"."kitchen_id" in ($3))) ORDER BY "swk_suborder"."id" DESC
1 min < 0.1% 269 ms 174 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2)) AND (("swk_suborder"."kitchen_id" in ($3))  OR  ("swk_suborder"."kitchen_id" in ($4))) ORDER BY "swk_suborder"."id" DESC
1 min < 0.1% 429 ms 108 odoo
SELECT min("order_dispatch".id) AS id, count("order_dispatch".id) AS "__count" , "order_dispatch"."warehouse_id" as "warehouse_id" ,"order_dispatch"."state" as "state" 
            FROM "order_dispatch" LEFT JOIN "stock_warehouse" as "order_dispatch__warehouse_id" ON ("order_dispatch"."warehouse_id" = "order_dispatch__warehouse_id"."id")
            WHERE (("order_dispatch"."create_date" >= $1)  AND  ("order_dispatch"."create_date" <= $2))
            GROUP BY "order_dispatch"."warehouse_id","order_dispatch"."state","order_dispatch__warehouse_id"."name"
            ORDER BY  "order_dispatch__warehouse_id"."name"  ,"state"
1 min < 0.1% 218 ms 209 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."food_item" in ($1)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (food_item, id)
Rows: 1420575
Row progression: 1420575, 664, 0

Row estimates
- food_item (=): 664
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
1 min < 0.1% 769 ms 57 odoo
SELECT min("mrp_production".id) AS id, count("mrp_production".id) AS "picking_type_id_count" , "mrp_production"."picking_type_id" as "picking_type_id" 
            FROM "mrp_production" LEFT JOIN "stock_picking_type" as "mrp_production__picking_type_id" ON ("mrp_production"."picking_type_id" = "mrp_production__picking_type_id"."id")
            WHERE (((("mrp_production"."date_planned_start" < $1)  AND  ("mrp_production"."state" = $2))  AND  (("mrp_production"."state" not in ($3,$4)) OR "mrp_production"."state" IS NULL))  AND  ("mrp_production"."picking_type_id" in ($5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60,$61))) AND (("mrp_production"."company_id" in ($62))  OR  "mrp_production"."company_id" IS NULL )
            GROUP BY "mrp_production"."picking_type_id","mrp_production__picking_type_id"."sequence","mrp_production__picking_type_id"."id"
            ORDER BY  "mrp_production__picking_type_id"."sequence" ,"mrp_production__picking_type_id"."id"
1 min < 0.1% 743 ms 57 odoo
SELECT min("mrp_production".id) AS id, count("mrp_production".id) AS "picking_type_id_count" , "mrp_production"."picking_type_id" as "picking_type_id" 
            FROM "mrp_production" LEFT JOIN "stock_picking_type" as "mrp_production__picking_type_id" ON ("mrp_production"."picking_type_id" = "mrp_production__picking_type_id"."id")
            WHERE ((("mrp_production"."state" in ($1,$2,$3))  AND  (("mrp_production"."state" not in ($4,$5)) OR "mrp_production"."state" IS NULL))  AND  ("mrp_production"."picking_type_id" in ($6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60,$61,$62))) AND (("mrp_production"."company_id" in ($63))  OR  "mrp_production"."company_id" IS NULL )
            GROUP BY "mrp_production"."picking_type_id","mrp_production__picking_type_id"."sequence","mrp_production__picking_type_id"."id"
            ORDER BY  "mrp_production__picking_type_id"."sequence" ,"mrp_production__picking_type_id"."id"
1 min < 0.1% 34 ms 1,162 odoo
SELECT min("sale_report".id) AS id, count("sale_report".id) AS "__count" , sum("sale_report"."price_subtotal") AS "price_subtotal" ,"sale_report"."warehouse_id" as "warehouse_id" ,"sale_report"."team_id" as "team_id" 
            FROM "sale_report" LEFT JOIN "stock_warehouse" as "sale_report__warehouse_id" ON ("sale_report"."warehouse_id" = "sale_report__warehouse_id"."id") LEFT JOIN "crm_team" as "sale_report__team_id" ON ("sale_report"."team_id" = "sale_report__team_id"."id") LEFT JOIN 
                (SELECT DISTINCT ON (res_id) res_id, value
                 FROM "ir_translation"
                 WHERE name=$1 AND lang=$2 AND value!=$3
                 ORDER BY res_id, id DESC)
             as "sale_report__team_id__name" ON ("sale_report__team_id"."id" = "sale_report__team_id__name"."res_id")
            WHERE (("sale_report"."date" <= $4)  AND  ("sale_report"."date" >= $5)) AND ("sale_report"."company_id" IS NULL   OR  ("sale_report"."company_id" in ($6)))
            GROUP BY "sale_report"."warehouse_id","sale_report"."team_id","sale_report__warehouse_id"."name",COALESCE("sale_report__team_id__name"."value","sale_report__team_id"."name")
            ORDER BY  "sale_report__warehouse_id"."name"  , COALESCE("sale_report__team_id__name"."value", "sale_report__team_id"."name")
1 min < 0.1% 0 ms 203,286 odoo
UPDATE "order_dispatch" SET "state"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 653422
Row progression: 653422, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- edd
- retry
- state
- sync_id
1 min < 0.1% 0 ms 178,751 odoo
SELECT substr(p.res_id, $1)::integer, p.value_float
                FROM ir_property p
                WHERE p.fields_id=$2
                    AND (p.company_id=$3 OR p.company_id IS NULL)
                    AND (p.res_id IN ($4) OR p.res_id IS NULL)
                ORDER BY p.company_id NULLS FIRST
1 min < 0.1% 10 ms 3,957 odoo
SELECT "product_product".id FROM "product_product" WHERE (((("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($3))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($4)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
1 min < 0.1% 1 ms 72,661 odoo
INSERT INTO "mrp_production" ("id", "product_id", "is_locked", "picking_type_id", "origin", "company_id", "date_planned_start", "product_qty", "propagate", "bom_id", "name", "priority", "procurement_group_id", "date_planned_finished", "user_id", "product_uom_id", "location_dest_id", "state", "suborder_id", "location_src_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, (now() at time zone $23), (now() at time zone $24)) RETURNING id
1 min < 0.1% 127 ms 294 odoo
SELECT "product_product".id FROM "product_product" WHERE (("product_product"."active" = $1)  AND  ("product_product"."barcode"::text ilike $2)) ORDER BY "product_product"."default_code" ,"product_product"."id"
1 min < 0.1% 60 ms 626 odoo
SELECT "product_product".id FROM "product_product" WHERE ((((((((("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($3))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($4))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($5))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($6))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($7))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($8))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($9)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
1 min < 0.1% 0 ms 145,322 odoo
UPDATE "swk_suborder" SET "production_cost"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
1 min < 0.1% 70 ms 524 odoo
SELECT "product_product".id FROM "product_product" WHERE (((((((((("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($3))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($4))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($5))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($6))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($7))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($8))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($9))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($10)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
1 min < 0.1% 0 ms 72,661 odoo
INSERT INTO "swk_suborder" ("id", "quantity", "employee_meal", "menu_item", "printed", "items_in_combo", "so_id", "forced", "food_item", "name", "pending_checked", "so_line_id", "product_uom_id", "state", "processed", "date", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, (now() at time zone $19), (now() at time zone $20)) RETURNING id
1 min < 0.1% 0 ms 135,745 odoo
INSERT INTO product_attribute_value_product_configurator_attribute_rel (product_configurator_attribute_id, product_attribute_value_id)
                        (SELECT a, b FROM unnest(ARRAY[$1]) AS a, unnest(ARRAY[$2]) AS b)
                        EXCEPT (SELECT product_configurator_attribute_id, product_attribute_value_id FROM product_attribute_value_product_configurator_attribute_rel WHERE product_configurator_attribute_id IN ($3))
1 min < 0.1% 31 ms 1,075 odoo
SELECT "product_product".id FROM "product_product" WHERE ((((((("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($3))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($4))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($5))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($6))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($7)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
1 min < 0.1% 0 ms 190,033 odoo
INSERT INTO "product_configurator_attribute" ("id", "product_tmpl_id", "minimum", "maximum", "owner_model", "attribute_id", "owner_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, (now() at time zone $10), (now() at time zone $11)) RETURNING id
1 min < 0.1% 71 ms 441 odoo
SELECT count($1) FROM "sale_order" WHERE (((("sale_order"."state" in ($2,$3))  AND  ("sale_order"."employee_meal" IS NULL or "sale_order"."employee_meal" = $4 ))  AND  ("sale_order"."warehouse_id" = $5))  AND  ("sale_order"."is_food_order" = $6)) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($7)))  AND  (("sale_order"."warehouse_id" in ($8))  OR  ("sale_order"."warehouse_id" in ($9))))
1 min < 0.1% 0 ms 320,220 odoo
UPDATE "product_configurator_attribute" SET "write_uid"=$1,"write_date"=(now() at time zone $2) WHERE id IN ($3)
Covered by index on (id)
Rows: 31933538
Row progression: 31933538, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- owner_id
- owner_model
1 min < 0.1% 0 ms 72,661 odoo
UPDATE "swk_suborder" SET "brand_id"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
0 min < 0.1% 643 ms 43 odoo
DELETE FROM mrp_bom_line WHERE id IN ($1)
Covered by index on (id)
Rows: 65754
Row progression: 65754, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- bom_id
0 min < 0.1% 642 ms 43 odoo
UPDATE ONLY "public"."stock_move" SET "bom_line_id" = $2 WHERE $1 OPERATOR(pg_catalog.=) "bom_line_id"
0 min < 0.1% 222 ms 123 odoo
SELECT min("mrp_production".id) AS id, count("mrp_production".id) AS "product_id_count" , "mrp_production"."product_id" as "product_id" 
            FROM "mrp_production" LEFT JOIN "product_product" as "mrp_production__product_id" ON ("mrp_production"."product_id" = "mrp_production__product_id"."id")
            WHERE ("mrp_production"."product_id" in ($1)) AND (("mrp_production"."company_id" in ($2))  OR  "mrp_production"."company_id" IS NULL )
            GROUP BY "mrp_production"."product_id","mrp_production__product_id"."default_code","mrp_production__product_id"."id"
            ORDER BY  "mrp_production__product_id"."default_code" ,"mrp_production__product_id"."id"
0 min < 0.1% 26 ms 1,058 odoo
SELECT "product_product".id FROM "product_product" WHERE (((((("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($3))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($4))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($5))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($6)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
0 min < 0.1% 0 ms 72,661 odoo
UPDATE "swk_suborder" SET "manufacturing_order"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
0 min < 0.1% 3 ms 9,907 odoo
SELECT "product_product"."id" as "id","product_product"."product_tmpl_id" as "product_tmpl_id" FROM "product_product" WHERE "product_product".id IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $60, $61, $62, $63, $64, $65, $66, $67, $68, $69, $70, $71, $72, $73, $74, $75, $76, $77, $78, $79, $80, $81, $82, $83, $84, $85, $86, $87, $88, $89, $90, $91, $92, $93, $94, $95, $96, $97, $98, $99, $100, $101, $102, $103, $104, $105, $106, $107, $108, $109, $110, $111, $112, $113, $114, $115, $116, $117, $118, $119, $120, $121, $122, $123, $124, $125, $126, $127, $128, $129, $130, $131, $132, $133, $134, $135, $136, $137, $138, $139, $140, $141, $142, $143, $144, $145, $146, $147, $148, $149, $150, $151, $152, $153, $154, $155, $156, $157, $158, $159, $160, $161, $162, $163, $164, $165, $166, $167, $168, $169, $170, $171, $172, $173, $174, $175, $176, $177, $178, $179, $180, $181, $182, $183, $184, $185, $186, $187, $188, $189, $190, $191, $192, $193, $194, $195, $196, $197, $198, $199, $200, $201, $202, $203, $204, $205, $206, $207, $208, $209, $210, $211, $212, $213, $214, $215, $216, $217, $218, $219, $220, $221, $222, $223, $224, $225, $226, $227, $228, $229, $230, $231, $232, $233, $234, $235, $236, $237, $238, $239, $240, $241, $242, $243, $244, $245, $246, $247, $248, $249, $250, $251, $252, $253, $254, $255, $256, $257, $258, $259, $260, $261, $262, $263, $264, $265, $266, $267, $268, $269, $270, $271, $272, $273, $274, $275, $276, $277, $278, $279, $280, $281, $282, $283, $284, $285, $286, $287, $288, $289, $290, $291, $292, $293, $294, $295, $296, $297, $298, $299, $300, $301, $302, $303, $304, $305, $306, $307, $308, $309, $310, $311, $312, $313, $314, $315, $316, $317, $318, $319, $320, $321, $322, $323, $324, $325, $326, $327, $328, $329, $330, $331, $332, $333, $334, $335, $336, $337, $338, $339, $340, $341, $342, $343, $344, $345, $346, $347, $348, $349, $350, $351, $352, $353, $354, $355, $356, $357, $358, $359, $360, $361, $362, $363, $364, $365, $366, $367, $368, $369, $370, $371, $372, $373, $374, $375, $376, $377, $378, $379, $380, $381, $382, $383, $384, $385, $386, $387, $388, $389, $390, $391, $392, $393, $394, $395, $396, $397, $398, $399, $400, $401, $402, $403, $404, $405, $406, $407, $408, $409, $410, $411, $412, $413, $414, $415, $416, $417, $418, $419, $420, $421, $422, $423, $424, $425, $426, $427, $428, $429, $430, $431, $432, $433, $434, $435, $436, $437, $438, $439, $440, $441, $442, $443, $444, $445, $446, $447, $448, $449, $450, $451, $452, $453, $454, $455, $456, $457, $458, $459, $460, $461, $462, $463, $464, $465, $466, $467, $468, $469, $470, $471, $472, $473, $474, $475, $476, $477, $478, $479, $480, $481, $482, $483, $484, $485, $486, $487, $488, $489, $490, $491, $492, $493, $494, $495, $496, $497, $498, $499, $500, $501, $502, $503, $504, $505, $506, $507, $508, $509, $510, $511, $512, $513, $514, $515, $516, $517, $518, $519, $520, $521, $522, $523, $524, $525, $526, $527, $528, $529, $530, $531, $532, $533, $534, $535, $536, $537, $538, $539, $540, $541, $542, $543, $544, $545, $546, $547, $548, $549, $550, $551, $552, $553, $554, $555, $556, $557, $558, $559, $560, $561, $562, $563, $564, $565, $566, $567, $568, $569, $570, $571, $572, $573, $574, $575, $576, $577, $578, $579, $580, $581, $582, $583, $584, $585, $586, $587, $588, $589, $590, $591, $592, $593, $594, $595, $596, $597, $598, $599, $600, $601, $602, $603, $604, $605, $606, $607, $608, $609, $610, $611, $612, $613, $614, $615, $616, $617, $618, $619, $620, $621, $622, $623, $624, $625, $626, $627, $628, $629, $630, $631, $632, $633, $634, $635, $636, $637, $638, $639, $640, $641, $642, $643, $644, $645, $646, $647, $648, $649, $650, $651, $652, $653, $654, $655, $656, $657, $658, $659, $660, $661, $662, $663, $664, $665, $666, $667, $668, $669, $670, $671, $672, $673, $674, $675, $676, $677, $678, $679, $680, $681, $682, $683, $684, $685, $686, $687, $688, $689, $690, $691, $692, $693, $694, $695, $696, $697, $698, $699, $700, $701, $702, $703, $704, $705, $706, $707, $708, $709, $710, $711, $712, $713, $714, $715, $716, $717, $718, $719, $720, $721, $722, $723, $724, $725, $726, $727, $728, $729, $730, $731, $732, $733, $734, $735, $736, $737, $738, $739, $740, $741, $742, $743, $744, $745, $746, $747, $748, $749, $750, $751, $752, $753, $754, $755, $756, $757, $758, $759, $760, $761, $762, $763, $764, $765, $766, $767, $768, $769, $770, $771, $772, $773, $774, $775, $776, $777, $778, $779, $780, $781, $782, $783, $784, $785, $786, $787, $788, $789, $790, $791, $792, $793, $794, $795, $796, $797, $798, $799, $800, $801, $802, $803, $804, $805, $806, $807, $808, $809, $810, $811, $812, $813, $814, $815, $816, $817, $818, $819, $820, $821, $822, $823, $824, $825, $826, $827, $828, $829, $830, $831, $832, $833, $834, $835, $836, $837, $838, $839, $840, $841, $842, $843, $844, $845, $846, $847, $848, $849, $850, $851, $852, $853, $854, $855, $856, $857, $858, $859, $860, $861, $862, $863, $864, $865, $866, $867, $868, $869, $870, $871, $872, $873, $874, $875, $876, $877, $878, $879, $880, $881, $882, $883, $884, $885, $886, $887, $888, $889, $890, $891, $892, $893, $894, $895, $896, $897, $898, $899, $900, $901, $902, $903, $904, $905, $906, $907, $908, $909, $910, $911, $912, $913, $914, $915, $916, $917, $918, $919, $920, $921, $922, $923, $924, $925, $926, $927, $928, $929, $930, $931, $932, $933, $934, $935, $936, $937, $938, $939, $940, $941, $942, $943, $944, $945, $946, $947, $948, $949, $950, $951, $952, $953, $954, $955, $956, $957, $958, $959, $960, $961, $962, $963, $964, $965, $966, $967, $968, $969, $970, $971, $972, $973, $974, $975, $976, $977, $978, $979, $980, $981, $982, $983, $984, $985, $986, $987, $988, $989, $990, $991, $992, $993, $994, $995, $996, $997, $998, $999, $1000)
Covered by index on (id)
Rows: 1224790
Row progression: 1224790, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- barcode UNIQUE
- default_code
- product_tmpl_id
0 min < 0.1% 0 ms 72,661 odoo
UPDATE "swk_suborder" SET "platform_id"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
0 min < 0.1% 0 ms 72,661 odoo
UPDATE "swk_suborder" SET "state"=$1,"notification_date"=$2,"write_uid"=$3,"write_date"=(now() at time zone $4) WHERE id IN ($5)
Covered by index on (id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
0 min < 0.1% 0 ms 55,037 odoo
INSERT INTO "sale_order_line" ("id", "product_tmpl_id", "is_downpayment", "items_in_combo", "is_gift", "product_packaging", "order_id", "suborder_created", "product_uom_qty", "comment", "qty_delivered", "purchase_price_food", "state", "product_id", "discount", "invoice_status", "sequence", "name", "purchase_price", "purchase_price_nonfood", "price_unit", "product_uom", "customer_lead", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, (now() at time zone $26), (now() at time zone $27)) RETURNING id
0 min < 0.1% 0 ms 72,661 odoo
UPDATE "swk_suborder" SET "order_partner_id"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
0 min < 0.1% 0 ms 130,187 odoo
INSERT INTO "product_configurator_attribute" ("id", "owner_id", "product_tmpl_id", "owner_model", "attribute_id", "maximum", "minimum", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, (now() at time zone $10), (now() at time zone $11)) RETURNING id
0 min < 0.1% 0 ms 1,560,124 odoo
SELECT $2 FROM ONLY "public"."res_currency" x WHERE "id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x
0 min < 0.1% 0 ms 72,661 odoo
UPDATE "swk_suborder" SET "kitchen_id"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
0 min < 0.1% 0 ms 67,269 odoo
UPDATE "stock_move" SET "reference"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 1319563
Row progression: 1319563, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- company_id
- create_date
- created_production_id
- date
- date_expected
- location_dest_id
- location_id
- name
- origin_returned_move_id
- picking_id
- product_id
- product_id, location_id, location_dest_id, company_id, state
- product_id, location_id, location_dest_id, state
- production_id
- purchase_line_id
- raw_material_production_id
- sale_line_id
- scrapped
- state
0 min < 0.1% 1,351 ms 18 odoo
SELECT count($1) FROM "sale_order" WHERE (("sale_order"."fo_state" not in ($2,$3,$4)) OR "sale_order"."fo_state" IS NULL) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($5)))  AND  (("sale_order"."warehouse_id" in ($6,$7,$8,$9,$10))  OR  ("sale_order"."warehouse_id" in ($11,$12,$13,$14,$15))))
0 min < 0.1% 0 ms 105,741 odoo
INSERT INTO "mail_followers" ("id", "partner_id", "res_id", "res_model") VALUES(nextval($1), $2, $3, $4) RETURNING id
0 min < 0.1% 0 ms 72,664 odoo
UPDATE "mrp_production" SET "product_tmpl_id"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 1415785
Row progression: 1415785, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- date_finished
- date_planned_finished
- date_planned_start
- date_start
- name, company_id UNIQUE
0 min < 0.1% 0 ms 818,833 odoo
SELECT "sale_order_line"."id" as "id","sale_order_line"."price_tax" as "price_tax","sale_order_line"."salesman_id" as "salesman_id","sale_order_line"."state" as "state","sale_order_line"."write_date" as "write_date","sale_order_line"."product_uom_qty" as "product_uom_qty","sale_order_line"."comment" as "comment","sale_order_line"."route_id" as "route_id","sale_order_line"."price_total" as "price_total","sale_order_line"."customer_lead" as "customer_lead","sale_order_line"."currency_id" as "currency_id","sale_order_line"."combo_menu_item" as "combo_menu_item","sale_order_line"."name" as "name","sale_order_line"."purchase_price_food" as "purchase_price_food","sale_order_line"."combo_id" as "combo_id","sale_order_line"."is_gift" as "is_gift","sale_order_line"."order_id" as "order_id","sale_order_line"."is_downpayment" as "is_downpayment","sale_order_line"."price_reduce" as "price_reduce","sale_order_line"."amt_to_invoice" as "amt_to_invoice","sale_order_line"."discount_type" as "discount_type","sale_order_line"."suborder_created" as "suborder_created","sale_order_line"."invoice_status" as "invoice_status","sale_order_line"."qty_delivered" as "qty_delivered","sale_order_line"."company_id" as "company_id","sale_order_line"."purchase_price_nonfood" as "purchase_price_nonfood","sale_order_line"."menu_item_id" as "menu_item_id","sale_order_line"."product_id" as "product_id","sale_order_line"."layout_category_sequence" as "layout_category_sequence","sale_order_line"."price_reduce_taxinc" as "price_reduce_taxinc","sale_order_line"."amt_invoiced" as "amt_invoiced","sale_order_line"."product_tmpl_id" as "product_tmpl_id","sale_order_line"."discount_name" as "discount_name","sale_order_line"."price_unit" as "price_unit","sale_order_line"."qty_to_invoice" as "qty_to_invoice","sale_order_line"."order_partner_id" as "order_partner_id","sale_order_line"."create_uid" as "create_uid","sale_order_line"."sequence" as "sequence","sale_order_line"."product_uom" as "product_uom","sale_order_line"."price_reduce_taxexcl" as "price_reduce_taxexcl","sale_order_line"."margin" as "margin","sale_order_line"."discount_voucher_code" as "discount_voucher_code","sale_order_line"."price_subtotal" as "price_subtotal","sale_order_line"."qty_invoiced" as "qty_invoiced","sale_order_line"."create_date" as "create_date","sale_order_line"."layout_category_id" as "layout_category_id","sale_order_line"."write_uid" as "write_uid","sale_order_line"."items_in_combo" as "items_in_combo","sale_order_line"."discount" as "discount","sale_order_line"."purchase_price" as "purchase_price","sale_order_line"."product_packaging" as "product_packaging" FROM "sale_order_line" WHERE "sale_order_line".id IN ($1, $2)
Covered by index on (id)
Rows: 1352415
Row progression: 1352415, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- order_id
0 min < 0.1% 0 ms 1,009,873 odoo
SELECT count($1) FROM "order_dispatch" WHERE (("order_dispatch"."retry" IS NULL or "order_dispatch"."retry" = $2 )  AND  ("order_dispatch"."state" = $3))
0 min < 0.1% 451 ms 51 odoo
SELECT COUNT(DISTINCT so.partner_id) 
                FROM sale_order so
                WHERE so.is_food_order = $1 AND employee_meal = $2 AND so.state = $3 AND so.date_order >= $4 AND so.date_order <= $5 AND warehouse_id = $6 
                AND so.partner_id IN (SELECT DISTINCT so2.partner_id 
                                      FROM sale_order so2 
                                      WHERE so2.is_food_order = $7
                                      AND so2.date_order < $8 AND warehouse_id = $9)
                AND so.brand_id NOT IN (SELECT DISTINCT so3.brand_id 
                                        FROM sale_order so3 
                                        WHERE so3.is_food_order
                                        AND so3.partner_id = so.partner_id
                                        AND so3.date_order < $10 AND warehouse_id = $11
                                        AND so.brand_id = so3.brand_id)
0 min < 0.1% 188 ms 122 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9)) ORDER BY "swk_suborder"."id"
Details
CREATE INDEX CONCURRENTLY ON swk_suborder (so_line_id)
Rows: 1420575
Row progression: 1420575, 1

Row estimates
- so_line_id (=): 1
- id (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- date
- kitchen_id
- manufacturing_order
- name
- order_partner_id
- picking_id
- platform_id
- so_id
- state
0 min < 0.1% 17 ms 1,364 odoo
SELECT "product_product".id FROM "product_product" WHERE ((((("product_product"."product_tmpl_id" = $1)  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($2))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($3))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($4))))  AND  ("product_product"."id" in (SELECT "product_product_id" FROM "product_attribute_value_product_product_rel" WHERE "product_attribute_value_id" IN ($5)))) ORDER BY "product_product"."default_code" ,"product_product"."id"
0 min < 0.1% 2 ms 11,566 odoo
SELECT "product_product".id FROM "product_product" WHERE (("product_product"."active" = $1)  AND  ("product_product"."product_tmpl_id" in ($2))) ORDER BY "product_product"."default_code" ,"product_product"."id"
Covered by index on (product_tmpl_id)
Rows: 1224790
Row progression: 1224790, 536, 268

Row estimates
- product_tmpl_id (=): 536
- active (=): 612395
- default_code (sort): 0
- id (sort): 1

Existing indexes
- id PRIMARY
- barcode UNIQUE
- default_code
- product_tmpl_id
0 min < 0.1% 0 ms 37,869,806 odoo
ROLLBACK
0 min < 0.1% 429 ms 51 odoo
SELECT COUNT(DISTINCT partner_id) 
                FROM sale_order
                WHERE is_food_order = $1 AND employee_meal = $2 AND state = $3 AND date_order >= $4 AND date_order <= $5 AND warehouse_id = $6
                AND partner_id IN (SELECT DISTINCT partner_id FROM sale_order WHERE is_food_order = $7 AND date_order < $8 AND warehouse_id = $9)
0 min < 0.1% 0 ms 149,367 odoo
SELECT product_attribute_line_product_attribute_value_rel.product_attribute_line_id, product_attribute_line_product_attribute_value_rel.product_attribute_value_id FROM product_attribute_line_product_attribute_value_rel, "product_attribute_value" LEFT JOIN "product_attribute" as "product_attribute_value__attribute_id" ON ("product_attribute_value"."attribute_id" = "product_attribute_value__attribute_id"."id") LEFT JOIN 
                (SELECT DISTINCT ON (res_id) res_id, value
                 FROM "ir_translation"
                 WHERE name=$1 AND lang=$2 AND value!=$3
                 ORDER BY res_id, id DESC)
             as "product_attribute_value__attribute_id__name" ON ("product_attribute_value__attribute_id"."id" = "product_attribute_value__attribute_id__name"."res_id")
                    WHERE ("product_attribute_value"."active" = $4) AND product_attribute_line_product_attribute_value_rel.product_attribute_line_id IN ($5) AND product_attribute_line_product_attribute_value_rel.product_attribute_value_id = product_attribute_value.id
                     ORDER BY "product_attribute_value"."sequence" ,"product_attribute_value__attribute_id"."sequence" ,COALESCE("product_attribute_value__attribute_id__name"."value", "product_attribute_value__attribute_id"."name") ,"product_attribute_value"."id"    OFFSET $6