PgHero

Queries

Total Time Average Time Calls
2,981 min 31% 568 ms 314,971 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: 1465993
Row progression: 1465993, 5

Row estimates
- url (~~): 5
- create_uid (=): 366498
- datas_fname (sort): 1

Existing indexes
- id PRIMARY
- checksum
- res_model, res_id
- url
1,848 min 19% 2,559 ms 43,315 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
1,809 min 19% 490 ms 221,491 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: 1217485
Row progression: 1217485, 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
734 min 8% 540 ms 81,575 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: 1217485
Row progression: 1217485, 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 3% 541 ms 32,950 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: 1217485
Row progression: 1217485, 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
241 min 2% 4 ms 3,815,554 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
154 min 2% 432 ms 21,410 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: 1217077
Row progression: 1217077, 69, 0

Row estimates
- product_id (=): 69
- 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
120 min 1% 529 ms 13,632 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: 1217485
Row progression: 1217485, 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
120 min 1% 0 ms 215,627,984 odoo
DISCARD ALL
85 min 0.9% 1,948 ms 2,614 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))))
82 min 0.9% 1 ms 3,522,371 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 )
65 min 0.7% 1,063 ms 3,694 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))))
50 min 0.5% 536 ms 5,627 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: 1217485
Row progression: 1217485, 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 0.5% 0 ms 107,117,719 odoo
SELECT base_registry_signaling.last_value,
                                  base_cache_signaling.last_value
                           FROM base_registry_signaling, base_cache_signaling
33 min 0.3% 0 ms 258,040,472 odoo
BEGIN ISOLATION LEVEL REPEATABLE READ
33 min 0.3% 0 ms 45,606,442 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))
32 min 0.3% 4,062 ms 473 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)
30 min 0.3% 6,133 ms 295 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
29 min 0.3% 667 ms 2,602 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
27 min 0.3% 12,445 ms 128 odoo
SELECT res_partner.id
                         FROM "res_partner"
                       WHERE (("res_partner"."type" != $1)  OR  "res_partner"."type" IS NULL ) AND  (res_partner.email ilike $2
                           OR res_partner.display_name ilike $3
                           OR res_partner.ref ilike $4
                           OR res_partner.vat ilike $5)
                           -- don't panic, trust postgres bitmap
                     ORDER BY res_partner.display_name ilike $6 desc,
                              res_partner.display_name
26 min 0.3% 0 ms 31,974,692 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
24 min 0.2% 552 ms 2,591 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: 1217485
Row progression: 1217485, 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
18 min 0.2% 0 ms 43,080,071 odoo
SELECT id FROM "res_users" WHERE id IN ($1)
18 min 0.2% 2 ms 446,713 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
18 min 0.2% 0 ms 3,568,109 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))
16 min 0.2% 1,652 ms 592 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))))
16 min 0.2% 3 ms 359,226 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
15 min 0.2% 3 ms 290,270 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
14 min 0.1% 0 ms 9,214,553 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
14 min 0.1% 274 ms 3,005 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
13 min 0.1% 954 ms 840 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
12 min 0.1% 558 ms 1,317 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: 1217485
Row progression: 1217485, 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
11 min 0.1% 767 ms 883 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
11 min 0.1% 5 ms 139,858 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
11 min 0.1% 4,943 ms 128 odoo
SELECT res_partner.id
                         FROM "res_partner"
                       WHERE ("res_partner"."active" = $1) AND  (res_partner.email ilike $2
                           OR res_partner.display_name ilike $3
                           OR res_partner.ref ilike $4
                           OR res_partner.vat ilike $5)
                           -- don't panic, trust postgres bitmap
                     ORDER BY res_partner.display_name ilike $6 desc,
                              res_partner.display_name
10 min 0.1% 1,864 ms 323 odoo
SELECT min("sale_order".id) AS id, count("sale_order".id) AS "warehouse_id_count" , sum("sale_order"."amount_total") AS "amount_total" ,"sale_order"."warehouse_id" as "warehouse_id" 
            FROM "sale_order" LEFT JOIN "stock_warehouse" as "sale_order__warehouse_id" ON ("sale_order"."warehouse_id" = "sale_order__warehouse_id"."id")
            WHERE (("sale_order"."fo_state" not in ($1,$2,$3)) OR "sale_order"."fo_state" IS NULL) AND (("sale_order"."company_id" IS NULL   OR  ("sale_order"."company_id" in ($4)))  AND  (("sale_order"."warehouse_id" in ($5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15))  OR  ("sale_order"."warehouse_id" in ($16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26))))
            GROUP BY "sale_order"."warehouse_id","sale_order__warehouse_id"."name"
            ORDER BY  "sale_order__warehouse_id"."name"
10 min 0.1% 26 ms 22,736 odoo
UPDATE "product_product" SET "write_uid"=$1,"write_date"=(now() at time zone $2) WHERE id IN ($3)
Covered by index on (id)
Rows: 1137427
Row progression: 1137427, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- barcode UNIQUE
- default_code
- product_tmpl_id
9 min < 0.1% 674 ms 790 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
8 min < 0.1% 1,069 ms 473 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)
8 min < 0.1% 1,042 ms 475 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))))
8 min < 0.1% 1,028 ms 473 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)
8 min < 0.1% 207 ms 2,223 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))))
7 min < 0.1% 1,801 ms 241 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: 534755
Row progression: 534755, 53476

Row estimates
- create_date (>=): 53476
- create_date (<=): 53476
- state (sort): 267378

Existing indexes
- id PRIMARY
- edd
- retry
- state
- sync_id
7 min < 0.1% 1,784 ms 241 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: 534755
Row progression: 534755, 53476

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

Existing indexes
- id PRIMARY
- edd
- retry
- state
- sync_id
7 min < 0.1% 1,777 ms 241 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"
7 min < 0.1% 3 ms 139,866 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
6 min < 0.1% 13 ms 29,183 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"
6 min < 0.1% 817 ms 470 odoo
SELECT count($1) FROM "swk_suborder" WHERE ("swk_suborder"."state" in ($2,$3)) AND (("swk_suborder"."kitchen_id" in ($4))  OR  ("swk_suborder"."kitchen_id" in ($5)))
6 min < 0.1% 7 ms 52,707 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: 1137427
Row progression: 1137427, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- barcode UNIQUE
- default_code
- product_tmpl_id
6 min < 0.1% 1,649 ms 209 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))  OR  ("sale_order"."warehouse_id" in ($14,$15,$16,$17,$18,$19))))
6 min < 0.1% 533 ms 628 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: 1217485
Row progression: 1217485, 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
5 min < 0.1% 182 ms 1,803 odoo
SELECT schemaname AS schema, t.relname AS table, ix.relname AS name, regexp_replace(pg_get_indexdef(i.indexrelid), $1, $2) AS columns, regexp_replace(pg_get_indexdef(i.indexrelid), $3, $4) AS using, indisunique AS unique, indisprimary AS primary, indisvalid AS valid, indexprs::text, indpred::text, pg_get_indexdef(i.indexrelid) AS definition FROM pg_index i INNER JOIN pg_class t ON t.oid = i.indrelid INNER JOIN pg_class ix ON ix.oid = i.indexrelid LEFT JOIN pg_stat_user_indexes ui ON ui.indexrelid = i.indexrelid WHERE schemaname IS NOT NULL ORDER BY 1, 2 /*pghero*/
5 min < 0.1% 3,035 ms 106 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))) AND (("mrp_production"."company_id" in ($61))  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"
5 min < 0.1% 178 ms 1,801 odoo
WITH query_stats AS ( SELECT LEFT(query, $1) AS query, queryid AS query_hash, rolname AS user, ((total_plan_time + total_exec_time) / $2 / $3) AS total_minutes, ((total_plan_time + total_exec_time) / calls) AS average_time, calls FROM pg_stat_statements INNER JOIN pg_database ON pg_database.oid = pg_stat_statements.dbid INNER JOIN pg_roles ON pg_roles.oid = pg_stat_statements.userid WHERE calls > $4 AND pg_database.datname = current_database() ) SELECT query, query AS explainable_query, query_hash, query_stats.user, total_minutes, average_time, calls, total_minutes * $5 / (SELECT SUM(total_minutes) FROM query_stats) AS total_percent, (SELECT SUM(total_minutes) FROM query_stats) AS all_queries_total_minutes FROM query_stats ORDER BY "total_minutes" DESC LIMIT $6 /*pghero*/
5 min < 0.1% 2,971 ms 106 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))) AND (("mrp_production"."company_id" in ($60))  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"
5 min < 0.1% 2 ms 182,923 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: 1465993
Row progression: 1465993, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- checksum
- res_model, res_id
- url
5 min < 0.1% 680 ms 406 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))  OR  ("sale_order"."warehouse_id" in ($19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29))))
5 min < 0.1% 0 ms 5,143,621 odoo
SELECT count($1) FROM "order_dispatch" WHERE (("order_dispatch"."retry" IS NULL or "order_dispatch"."retry" = $2 )  AND  ("order_dispatch"."state" = $3))
5 min < 0.1% 4,932 ms 55 odoo
SELECT res_partner.id
                         FROM "res_partner"
                       WHERE ("res_partner"."active" = $1) AND ((("res_partner"."type" != $2)  OR  "res_partner"."type" IS NULL )  OR  ("res_partner"."type" = $3)) AND  (res_partner.email ilike $4
                           OR res_partner.display_name ilike $5
                           OR res_partner.ref ilike $6
                           OR res_partner.vat ilike $7)
                           -- don't panic, trust postgres bitmap
                     ORDER BY res_partner.display_name ilike $8 desc,
                              res_partner.display_name
4 min < 0.1% 4 ms 69,287 odoo
SELECT "swk_brand"."id" as "id","swk_brand"."logo" as "logo" FROM "swk_brand" WHERE "swk_brand".id IN ($1)
4 min < 0.1% 1,562 ms 168 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))))
4 min < 0.1% 678 ms 379 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3)) AND (("swk_suborder"."kitchen_id" in ($4))  OR  ("swk_suborder"."kitchen_id" in ($5))) ORDER BY "swk_suborder"."id" DESC
4 min < 0.1% 18 ms 14,293 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"
4 min < 0.1% 1,020 ms 241 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"
4 min < 0.1% 1,529 ms 157 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"
4 min < 0.1% 80 ms 3,005 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__product_tmpl_id"."id" in (WITH temp_irt_current (id, name) as (
                            SELECT ct.id, coalesce(it.value,ct."name")
                            FROM product_template ct
                            LEFT JOIN ir_translation it ON (it.name = $18 and
                                        it.lang = $19 and
                                        it.type = $20 and
                                        it.res_id = ct.id and
                                        it.value != $21)
                            )
                            SELECT id FROM temp_irt_current WHERE name ilike $22 order by name
                            )))  AND  ($23 OR "product_product"."id" IS NULL)) ORDER BY "product_product"."default_code" ,"product_product"."id"   limit $24
4 min < 0.1% 0 ms 30,044,329 odoo
SELECT $2 FROM ONLY "public"."res_users" x WHERE "id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x
4 min < 0.1% 102 ms 2,319 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)))
4 min < 0.1% 9 ms 24,866 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: 1137427
Row progression: 1137427, 545, 273

Row estimates
- product_tmpl_id (=): 545
- active (=): 568714
- default_code (sort): 0
- id (sort): 1

Existing indexes
- id PRIMARY
- barcode UNIQUE
- default_code
- product_tmpl_id
4 min < 0.1% 100 ms 2,319 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")
4 min < 0.1% 3 ms 68,138 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
4 min < 0.1% 1 ms 409,517 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: 534755
Row progression: 534755, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- edd
- retry
- state
- sync_id
4 min < 0.1% 394 ms 536 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"
4 min < 0.1% 1 ms 398,304 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
3 min < 0.1% 89 ms 2,320 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"
3 min < 0.1% 1 ms 289,179 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))
3 min < 0.1% 512 ms 384 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: 1217485
Row progression: 1217485, 627, 0

Row estimates
- food_item (=): 627
- 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.1% 1 ms 150,751 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
3 min < 0.1% 1 ms 304,549 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: 1217485
Row progression: 1217485, 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
3 min < 0.1% 83 ms 2,281 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"
3 min < 0.1% 2,028 ms 93 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"."state" != $1)
            GROUP BY "order_dispatch"."state"
            ORDER BY "state"
3 min < 0.1% 1 ms 150,622 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
3 min < 0.1% 2,027 ms 90 odoo
SELECT min("order_dispatch".id) AS id, count("order_dispatch".id) AS "__count" 
            FROM "order_dispatch"
            WHERE ("order_dispatch"."state" != $1)
3 min < 0.1% 1,446 ms 124 odoo
UPDATE "product_template" SET "uom_po_id"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 15835
Row progression: 15835, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- company_id
- name
3 min < 0.1% 1,984 ms 90 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"."state" != $1)
            GROUP BY "order_dispatch"."warehouse_id","order_dispatch__warehouse_id"."name"
            ORDER BY  "order_dispatch__warehouse_id"."name"
3 min < 0.1% 0 ms 149,886,266 odoo
ROLLBACK
3 min < 0.1% 17 ms 10,485 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"
3 min < 0.1% 64 ms 2,718 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"
3 min < 0.1% 0 ms 737,215 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
3 min < 0.1% 0 ms 443,811 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
3 min < 0.1% 5 ms 31,883 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)) AND (("mrp_bom"."company_id" in ($5))  OR  "mrp_bom"."company_id" IS NULL ) ORDER BY "mrp_bom"."sequence" ,"mrp_bom__product_id"."default_code" ,"mrp_bom__product_id"."id"   limit $6
3 min < 0.1% 68 ms 2,305 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"
3 min < 0.1% 117 ms 1,332 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"
3 min < 0.1% 925 ms 168 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"
3 min < 0.1% 967 ms 158 odoo
SELECT count($1) FROM "sale_order" WHERE (("sale_order"."fo_state" not in ($2,$3,$4)) OR "sale_order"."fo_state" IS NULL)
3 min < 0.1% 1 ms 152,316 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: 1217485
Row progression: 1217485, 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
3 min < 0.1% 1 ms 152,233 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: 1217485
Row progression: 1217485, 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
3 min < 0.1% 114 ms 1,329 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"
2 min < 0.1% 789 ms 188 odoo
SELECT "swk_suborder".id FROM "swk_suborder" WHERE ("swk_suborder"."so_line_id" in ($1,$2,$3,$4)) AND (("swk_suborder"."kitchen_id" in ($5))  OR  ("swk_suborder"."kitchen_id" in ($6))) ORDER BY "swk_suborder"."id" DESC
2 min < 0.1% 2,631 ms 56 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))))