PgHero
2 long running queries
Connections healthy 37
Vacuuming healthy
No columns near integer overflow
No invalid indexes or constraints
26 duplicate indexes
6 suggested indexes
86 slow queries

Long Running Queries

We recommend setting a statement timeout on all non-superusers with:

ALTER ROLE <user> SET statement_timeout TO '60s';
Pid Duration State
652962 00:43:11 idle in transaction
odoo14
SELECT name, id, state, demo AS dbdemo, latest_version AS installed_version  FROM ir_module_module WHERE name IN ('base', 'uom', 'customer_search_filter', 'list_view_sticky_header', 'web', 'bus', 'barcodes', 'login_user_detail', 'web_editor', 'auth_totp', 'resource', 'web_sheet_full_width', 'smile_audit', 'sql_request_abstract', 'web_tour', 'hspl_user_simulation', 'filter_multi_user', 'web_group_expand', 'web_refresher', 'muk_web_theme', 'web_fontawesome', 'web_widget_url_advanced', 'utm', 'social_media', 'base_address_city', 'attachment_indexation', 'web_kanban_gauge', 'base_import', 'inputmask_widget', 'base_setup', 'google_account', 'web_widget_numeric_step', 'http_routing', 'web_dialog_size', 'microsoft_account', 'mail', 'contacts', 'product', 'sql_export', 'link_tracker', 'google_drive', 'sql_export_mail', 'hr', 'prt_email_from', 'gamification', 'web_pwa_oca', 'web_unsplash', 'auto_backup_upload', 'ARABIA_debug_mode', 'access_cost_price_product', 'iap', 'auth_signup', 'base_automation', 'phone_validatio
652967 00:43:07 idle in transaction
odoo14
SELECT value FROM ir_translation
                       WHERE lang='ar_001' AND type in ('code') AND src='This name is already registered with this product type.' AND md5(src)=md5('This name is already registered with this product type.')

Duplicate Indexes

These indexes exist, but aren’t needed. Remove them for faster writes.

Details
On account_account
account_account_code_index (code)
is covered by
account_account_code_company_uniq (code, company_id)
On bus_presence
bus_presence_user_id_index (user_id)
is covered by
bus_presence_bus_user_presence_unique (user_id)
On crm_lead
crm_lead_user_id_index (user_id)
is covered by
crm_lead_user_id_team_id_type_index (user_id, team_id, type)
On decimal_precision
decimal_precision_name_index (name)
is covered by
decimal_precision_name_uniq (name)
On hr_job
hr_job_name_index (name)
is covered by
hr_job_name_company_uniq (name, company_id, department_id)
On ir_config_parameter
ir_config_parameter_key_index (key)
is covered by
ir_config_parameter_key_uniq (key)
On ir_model
ir_model_model_index (model)
is covered by
ir_model_obj_name_uniq (model)
On ir_model_constraint
ir_model_constraint_name_index (name)
is covered by
ir_model_constraint_module_name_uniq (name, module)
On ir_model_fields
ir_model_fields_model_index (model)
is covered by
ir_model_fields_name_unique (model, name)
On ir_model_fields_selection
ir_model_fields_selection_field_id_index (field_id)
is covered by
ir_model_fields_selection_selection_field_uniq (field_id, value)
On ir_module_module
ir_module_module_name_index (name)
is covered by
name_uniq (name)
On ir_ui_view
ir_ui_view_model_index (model)
is covered by
ir_ui_view_model_type_inherit_id (model, inherit_id)
On ir_ui_view_custom
ir_ui_view_custom_user_id_index (user_id)
is covered by
ir_ui_view_custom_user_id_ref_id (user_id, ref_id)
On mail_blacklist
mail_blacklist_email_index (email)
is covered by
mail_blacklist_unique_email (email)
On mail_followers
mail_followers_res_model_index (res_model)
is covered by
mail_followers_mail_followers_res_partner_res_model_id_uniq (res_model, res_id, partner_id)
On mail_message
mail_message_model_index (model)
is covered by
mail_message_model_res_id_idx (model, res_id)
On mail_message_res_partner_needaction_rel
mail_message_res_partner_needaction_rel_res_partner_id_index (res_partner_id)
is covered by
mail_notification_res_partner_id_is_read_notification_status_ma (res_partner_id, is_read, notification_status, mail_message_id)
On mail_moderation
mail_moderation_email_index (email)
is covered by
mail_moderation_channel_email_uniq (email, channel_id)
On payment_transaction
payment_transaction_reference_index (reference)
is covered by
payment_transaction_reference_uniq (reference)
On phone_blacklist
phone_blacklist_number_index (number)
is covered by
phone_blacklist_unique_number (number)
On product_template_attribute_value
product_template_attribute_value_attribute_line_id_index (attribute_line_id)
is covered by
product_template_attribute_value_attribute_value_unique (attribute_line_id, product_attribute_value_id)
On res_currency_rate
res_currency_rate_name_index (name)
is covered by
res_currency_rate_unique_name_per_day (name, currency_id, company_id)
On res_groups
res_groups_category_id_index (category_id)
is covered by
res_groups_name_uniq (category_id, name)
On stock_move
stock_move_product_id_index (product_id)
is covered by
stock_move_product_location_index (product_id, location_id, location_dest_id, company_id, state)
On stock_picking
stock_picking_name_index (name)
is covered by
stock_picking_name_uniq (name, company_id)
On stock_warehouse
stock_warehouse_name_index (name)
is covered by
stock_warehouse_warehouse_name_uniq (name, company_id)

Suggested Indexes

Add indexes to speed up queries.


Details
CREATE INDEX CONCURRENTLY ON asm_signature (sr_id)

to speed up

Total Time Average Time Calls
16 min 0.8% 35 ms 27,019 odoo14
SELECT "asm_signature".id FROM "asm_signature" WHERE ("asm_signature"."sr_id" in ($1)) ORDER BY  "asm_signature"."id"

Details
CREATE INDEX CONCURRENTLY ON asm_so (sr_id)

to speed up

Total Time Average Time Calls
44 min 2% 81 ms 32,247 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC

Details
CREATE INDEX CONCURRENTLY ON asm_sr (product_type, name)

to speed up

Total Time Average Time Calls
9 min 0.5% 141 ms 3,835 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE ("asm_sr"."product_type" in ($1)) ORDER BY  "asm_sr"."name" DESC,"asm_sr"."id" DESC

Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)

to speed up

Total Time Average Time Calls
18 min 0.9% 146 ms 7,282 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2))) ORDER BY  "ir_attachment"."id" DESC
16 min 0.9% 138 ms 7,166 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1))) ORDER BY  "ir_attachment"."id" DESC
12 min 0.6% 151 ms 4,804 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4))) ORDER BY  "ir_attachment"."id" DESC
9 min 0.5% 161 ms 3,495 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7))) ORDER BY  "ir_attachment"."id" DESC
9 min 0.5% 152 ms 3,569 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5))) ORDER BY  "ir_attachment"."id" DESC
8 min 0.4% 158 ms 3,190 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6))) ORDER BY  "ir_attachment"."id" DESC
8 min 0.4% 168 ms 2,985 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9))) ORDER BY  "ir_attachment"."id" DESC
8 min 0.4% 163 ms 3,004 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8))) ORDER BY  "ir_attachment"."id" DESC
8 min 0.4% 170 ms 2,809 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11))) ORDER BY  "ir_attachment"."id" DESC
8 min 0.4% 170 ms 2,773 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10))) ORDER BY  "ir_attachment"."id" DESC
7 min 0.4% 173 ms 2,492 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14))) ORDER BY  "ir_attachment"."id" DESC
7 min 0.4% 149 ms 2,840 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3))) ORDER BY  "ir_attachment"."id" DESC
6 min 0.3% 170 ms 2,185 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13))) ORDER BY  "ir_attachment"."id" DESC
6 min 0.3% 174 ms 2,060 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12))) ORDER BY  "ir_attachment"."id" DESC
6 min 0.3% 177 ms 1,869 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15))) ORDER BY  "ir_attachment"."id" DESC

Details
CREATE INDEX CONCURRENTLY ON ir_attachment (sr_id)

to speed up

Total Time Average Time Calls
59 min 3% 130 ms 27,357 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."sr_id" in ($1))) ORDER BY  "ir_attachment"."id" DESC

Details
CREATE INDEX CONCURRENTLY ON product_warranty (lot_id)

to speed up

Total Time Average Time Calls
5 min 0.3% 24 ms 13,093 odoo14
SELECT "product_warranty".id FROM "product_warranty" WHERE ("product_warranty"."lot_id" in ($1)) ORDER BY  "product_warranty"."id"

Slow Queries

Slow queries take 20 ms or more on average and have been called at least 100 times.

Explain queries to see where to add indexes.

Total Time Average Time Calls
96 min 5% 737 ms 7,800 odoo14
SELECT res_partner.id
                         FROM "res_partner"
                       WHERE (("res_partner"."active" = $1) AND (("res_partner"."name"::text ilike $2) OR (("res_partner"."mobile"::text ilike $3) OR (("res_partner"."city"::text ilike $4) OR (("res_partner"."email"::text ilike $5) OR (("res_partner"."phone"::text ilike $6) OR (("res_partner"."mobile2"::text ilike $7) OR (("res_partner"."ref"::text ilike $8) OR ("res_partner"."function"::text ilike $9))))))))) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $10 ) OR ("res_partner"."company_id" in ($11))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $12) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $13))) AND  (res_partner.email ilike $14
                           OR res_partner.display_name ilike $15
                           OR res_partner.ref ilike $16
                           OR res_partner.vat ilike $17)
                           -- don't panic, trust postgres bitmap
                     ORDER BY COALESCE(res_partner.customer_rank, $18) DESC, res_partner.display_name ilike $19 desc,
                              res_partner.display_name
                     limit $20
85 min 4% 373 ms 13,647 odoo14
SELECT res_partner.id
                         FROM "res_partner"
                       WHERE (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $1 ) OR ("res_partner"."company_id" in ($2))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $3) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $4))) AND  (res_partner.email ilike $5
                           OR res_partner.display_name ilike $6
                           OR res_partner.ref ilike $7
                           OR res_partner.vat ilike $8)
                           -- don't panic, trust postgres bitmap
                     ORDER BY  res_partner.display_name ilike $9 desc,
                              res_partner.display_name
66 min 3% 533 ms 7,435 odoo14
SELECT "mail_message".id FROM "mail_message" WHERE ((((("mail_message"."id" in (SELECT "mail_message_res_partner_needaction_rel"."mail_message_id" FROM "mail_message_res_partner_needaction_rel" WHERE ("mail_message_res_partner_needaction_rel"."notification_status" in ($1,$2)))) AND ("mail_message"."author_id" = $3)) AND ("mail_message"."res_id" != $4)) AND "mail_message"."model" IS NOT NULL) AND (("mail_message"."message_type" != $5) OR "mail_message"."message_type" IS NULL)) ORDER BY  "mail_message"."id" DESC
63 min 3% 255 ms 14,807 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND (((("asm_so"."service_center_id" in ($2)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($3,$4,$5,$6)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($7))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $8
59 min 3% 130 ms 27,357 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."sr_id" in ($1))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (sr_id)
57 min 3% 106 ms 32,387 odoo14
SELECT count($1) FROM "asm_so" WHERE (((("asm_so"."client_id" = $2) AND ("asm_so"."product_id" = $3)) AND (("asm_so"."id" != $4) OR "asm_so"."id" IS NULL)) AND "asm_so"."product_serial_warranty_id" IS NOT NULL)
53 min 3% 115 ms 27,920 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND (((("asm_so"."service_center_id" in ($2)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($3,$4,$5,$6)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($7))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
44 min 2% 81 ms 32,247 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON asm_so (sr_id)
34 min 2% 150 ms 13,482 odoo14
SELECT "asm_products_used".id FROM "asm_products_used" WHERE ((("asm_products_used"."product_id" = $1) AND ("asm_products_used"."location_id" = $2)) AND ("asm_products_used"."is_moved" IS NULL or "asm_products_used"."is_moved" = $3 )) ORDER BY  "asm_products_used"."id"
32 min 2% 123 ms 15,655 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND (((("asm_so"."service_center_id" in ($2)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($17))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
29 min 2% 132 ms 12,968 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (("asm_so"."so_state_id" = $1) AND ("asm_so"."so_type" = $2)) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113,$114)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($115,$116))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
26 min 1% 394 ms 4,021 odoo14
SELECT res_partner.id
                         FROM "res_partner"
                       WHERE ("res_partner"."active" = $1) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $2 ) OR ("res_partner"."company_id" in ($3))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $4) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $5))) AND  (res_partner.email ilike $6
                           OR res_partner.display_name ilike $7
                           OR res_partner.ref ilike $8
                           OR res_partner.vat ilike $9)
                           -- don't panic, trust postgres bitmap
                     ORDER BY COALESCE(res_partner.customer_rank, $10) DESC, res_partner.display_name ilike $11 desc,
                              res_partner.display_name
                     limit $12
22 min 1% 578 ms 2,297 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE ((($1 OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."phone"::text ilike $2) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $3 ) OR ("res_partner"."company_id" in ($4))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $5) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $6))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."mobile"::text ilike $7) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $8 ) OR ("res_partner"."company_id" in ($9))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $10) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $11))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."mobile2"::text ilike $12) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $13 ) OR ("res_partner"."company_id" in ($14))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $15) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $16))) ORDER BY  "res_partner"."id"  ))) AND (((("asm_sr"."service_center_id" in ($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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($112,$113,$114,$115,$116,$117,$118,$119,$120,$121,$122,$123,$124,$125,$126)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($127,$128))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $129
22 min 1% 118 ms 11,247 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND (((("asm_so"."service_center_id" in ($2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($15,$16,$17,$18,$19)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($20))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
22 min 1% 208 ms 6,355 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE ("asm_sr"."sr_state_id" = $1) AND (((("asm_sr"."service_center_id" in ($2)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($3,$4,$5,$6)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($7,$8))) ORDER BY  "asm_sr"."name" DESC,"asm_sr"."id" DESC  LIMIT $9
20 min 1% 221 ms 5,460 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_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)) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($176,$177,$178,$179,$180,$181,$182,$183,$184,$185,$186,$187,$188,$189,$190)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($191,$192))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
18 min 0.9% 146 ms 7,282 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
18 min 0.9% 558 ms 1,888 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE ((($1 OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."phone"::text ilike $2) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $3 ) OR ("res_partner"."company_id" in ($4))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $5) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $6))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."mobile"::text ilike $7) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $8 ) OR ("res_partner"."company_id" in ($9))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $10) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $11))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."mobile2"::text ilike $12) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $13 ) OR ("res_partner"."company_id" in ($14))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $15) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $16))) ORDER BY  "res_partner"."id"  ))) AND (((("asm_sr"."service_center_id" in ($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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($113,$114,$115,$116,$117,$118,$119,$120,$121,$122,$123,$124,$125,$126,$127)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($128,$129))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $130
16 min 0.9% 138 ms 7,166 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
16 min 0.8% 149 ms 6,438 odoo14
UPDATE account_move SET write_date = write_date WHERE id = (
                SELECT id FROM account_move
                WHERE journal_id = $1 AND name != $2 AND date_trunc($3, date::timestamp without time zone) = date_trunc($4, $5::date)  AND sequence_prefix !~ $6  AND move_type NOT IN ($7, $8)  AND id != $9 
                AND sequence_prefix = (SELECT sequence_prefix FROM account_move WHERE journal_id = $10 AND name != $11 AND date_trunc($12, date::timestamp without time zone) = date_trunc($13, $14::date)  AND sequence_prefix !~ $15  AND move_type NOT IN ($16, $17)  AND id != $18  ORDER BY id DESC LIMIT $19)
                ORDER BY sequence_number DESC
                LIMIT $20
            )
            RETURNING name
16 min 0.8% 35 ms 27,019 odoo14
SELECT "asm_signature".id FROM "asm_signature" WHERE ("asm_signature"."sr_id" in ($1)) ORDER BY  "asm_signature"."id"
Details
CREATE INDEX CONCURRENTLY ON asm_signature (sr_id)
15 min 0.8% 174 ms 5,156 odoo14
SELECT count($1) FROM "asm_sr" WHERE ("asm_sr"."sr_state_id" = $2) AND (((("asm_sr"."service_center_id" in ($3)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($4,$5,$6,$7)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($8,$9)))
14 min 0.8% 1,283 ms 678 odoo14
SELECT "res_partner".id FROM "res_partner" WHERE ((("res_partner"."active" = $1) AND ("res_partner"."parent_id" IS NULL  OR ("res_partner"."is_company" = $2))) AND (("res_partner"."name"::text ilike $3) OR (("res_partner"."mobile"::text ilike $4) OR (("res_partner"."city"::text ilike $5) OR (("res_partner"."email"::text ilike $6) OR (("res_partner"."phone"::text ilike $7) OR (("res_partner"."mobile2"::text ilike $8) OR (("res_partner"."ref"::text ilike $9) OR ("res_partner"."function"::text ilike $10))))))))) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $11 ) OR ("res_partner"."company_id" in ($12))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $13) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $14))) ORDER BY  "res_partner"."display_name"   LIMIT $15
14 min 0.8% 133 ms 6,530 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($97,$98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($112,$113))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
14 min 0.8% 214 ms 3,989 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_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)) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($177,$178,$179,$180,$181,$182,$183,$184,$185,$186,$187,$188,$189,$190,$191)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($192,$193))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
14 min 0.7% 156 ms 5,311 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE (((("asm_sr"."service_center_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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($96,$97,$98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($111,$112))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $113
14 min 0.7% 555 ms 1,463 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE ((($1 OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."phone"::text ilike $2) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $3 ) OR ("res_partner"."company_id" in ($4))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $5) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $6))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."mobile"::text ilike $7) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $8 ) OR ("res_partner"."company_id" in ($9))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $10) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $11))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."mobile2"::text ilike $12) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $13 ) OR ("res_partner"."company_id" in ($14))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $15) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $16))) ORDER BY  "res_partner"."id"  ))) AND (((("asm_sr"."service_center_id" in ($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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($114,$115,$116,$117,$118,$119,$120,$121,$122,$123,$124,$125,$126,$127,$128)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($129,$130))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $131
13 min 0.7% 111 ms 7,117 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) AND (((("asm_so"."service_center_id" in ($2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($15,$16,$17,$18,$19)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($20))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
13 min 0.7% 120 ms 6,581 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."url"::text like $1)) ORDER BY  "ir_attachment"."id" DESC
13 min 0.7% 124 ms 6,330 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."service_center_id" = $1) AND (((("asm_so"."service_center_id" in ($2,$3,$4,$5,$6,$7,$8,$9,$10,$11)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($12,$13,$14,$15,$16)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($17))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
12 min 0.6% 151 ms 4,804 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
12 min 0.6% 212 ms 3,388 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_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)) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($178,$179,$180,$181,$182,$183,$184,$185,$186,$187,$188,$189,$190,$191,$192)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($193,$194))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
12 min 0.6% 137 ms 5,195 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (("asm_so"."so_state_id" = $1) AND ("asm_so"."so_type" = $2)) AND (((("asm_so"."service_center_id" in ($3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($37,$38))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
11 min 0.6% 142 ms 4,839 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (("asm_so"."so_state_id" = $1) AND ("asm_so"."service_center_id" = $2)) AND (((("asm_so"."service_center_id" in ($3,$4,$5,$6,$7,$8,$9,$10,$11,$12)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($13,$14,$15,$16,$17)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($18))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
11 min 0.6% 310 ms 2,211 odoo14
SELECT DISTINCT ON(pid, cid) * FROM (
    WITH sub_followers AS (
        SELECT fol.id, fol.partner_id, fol.channel_id, subtype.internal
        FROM mail_followers fol
            RIGHT JOIN mail_followers_mail_message_subtype_rel subrel
            ON subrel.mail_followers_id = fol.id
            RIGHT JOIN mail_message_subtype subtype
            ON subtype.id = subrel.mail_message_subtype_id
        WHERE subrel.mail_message_subtype_id = $1 AND fol.res_model = $2 AND fol.res_id IN ($3)
    )
    SELECT partner.id as pid, $4::int AS cid,
            partner.active as active, partner.partner_share as pshare, $5 as ctype,
            users.notification_type AS notif, array_agg(groups.id) AS groups
        FROM res_partner partner
        LEFT JOIN res_users users ON users.partner_id = partner.id AND users.active
        LEFT JOIN res_groups_users_rel groups_rel ON groups_rel.uid = users.id
        LEFT JOIN res_groups groups ON groups.id = groups_rel.gid
        WHERE EXISTS (
            SELECT partner_id FROM sub_followers
            WHERE sub_followers.channel_id IS NULL
                AND sub_followers.partner_id = partner.id
                AND (coalesce(sub_followers.internal, $6) <> $7 OR coalesce(partner.partner_share, $8) <> $9)
        ) OR partner.id IN ($10)
        GROUP BY partner.id, users.notification_type
    UNION
    SELECT $11::int AS pid, channel.id AS cid,
            $12 as active, $13 AS pshare, channel.channel_type AS ctype,
            CASE WHEN channel.email_send = $14 THEN $15 ELSE $16 END AS notif, $17 AS groups
        FROM mail_channel channel
        WHERE EXISTS (
            SELECT channel_id FROM sub_followers WHERE partner_id IS NULL AND sub_followers.channel_id = channel.id
        ) 
) AS x
ORDER BY pid, cid, notif
11 min 0.6% 128 ms 5,315 odoo14
SELECT count($1) FROM "asm_sr" WHERE (((("asm_sr"."service_center_id" in ($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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($97,$98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($112,$113)))
11 min 0.6% 117 ms 5,437 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (((("asm_so"."service_center_id" in ($1)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($2,$3,$4,$5)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($6))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $7
10 min 0.5% 127 ms 4,631 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($113,$114))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
10 min 0.5% 116 ms 5,058 odoo14
SELECT count($1) FROM "asm_so" WHERE (((("asm_so"."service_center_id" in ($2)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($3,$4,$5,$6)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($7)))
10 min 0.5% 147 ms 3,929 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE (((("asm_sr"."service_center_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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($97,$98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($112,$113))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $114
10 min 0.5% 126 ms 4,531 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($114,$115))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
9 min 0.5% 161 ms 3,495 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
9 min 0.5% 152 ms 3,569 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
9 min 0.5% 141 ms 3,835 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE ("asm_sr"."product_type" in ($1)) ORDER BY  "asm_sr"."name" DESC,"asm_sr"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON asm_sr (product_type, name)
8 min 0.4% 158 ms 3,190 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
8 min 0.4% 168 ms 2,985 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
8 min 0.4% 122 ms 4,094 odoo14
SELECT min("asm_so".id) AS id, count("asm_so".id) AS "so_state_id_count" , sum("asm_so"."diff_last_activity_create") AS "diff_last_activity_create","asm_so"."so_state_id" as "so_state_id" 
            FROM "asm_so" LEFT JOIN "asm_state" AS "asm_so__so_state_id" ON ("asm_so"."so_state_id" = "asm_so__so_state_id"."id") LEFT JOIN "ir_translation" AS "asm_so__so_state_id__name" ON ("asm_so__so_state_id"."id" = "asm_so__so_state_id__name"."res_id" AND "asm_so__so_state_id__name"."type" = $1 AND "asm_so__so_state_id__name"."name" = $2 AND "asm_so__so_state_id__name"."lang" = $3 AND "asm_so__so_state_id__name"."value" != $4)
            WHERE (((("asm_so"."service_center_id" in ($5)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($6,$7,$8,$9)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($10)))
            GROUP BY "asm_so"."so_state_id","asm_so__so_state_id"."sequence",COALESCE("asm_so__so_state_id__name"."value","asm_so__so_state_id"."name"),"asm_so__so_state_id"."id"
            ORDER BY  "asm_so__so_state_id"."sequence" ,COALESCE("asm_so__so_state_id__name"."value", "asm_so__so_state_id"."name") ,"asm_so__so_state_id"."id"  
            LIMIT $11
8 min 0.4% 180 ms 2,772 odoo14
UPDATE "asm_products" SET "contract_id"=$1,"product_qty"=$2,"service_center_id"=$3,"write_uid"=$4,"write_date"=(now() at time zone $5) WHERE 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, $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, $1001, $1002, $1003, $1004, $1005)
8 min 0.4% 163 ms 3,004 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
8 min 0.4% 148 ms 3,307 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE (((("asm_sr"."service_center_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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($113,$114))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $115
8 min 0.4% 123 ms 3,944 odoo14
SELECT count($1) FROM "asm_sr" WHERE (((("asm_sr"."service_center_id" in ($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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($113,$114)))
8 min 0.4% 170 ms 2,809 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
8 min 0.4% 170 ms 2,773 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
7 min 0.4% 294 ms 1,521 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND ((((("asm_so"."service_center_id" in ($2)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($3,$4,$5,$6,$7)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($8,$9))) AND (("asm_so"."person_id" = $10) AND ((("asm_so"."so_state_id" in ($11)) OR ("asm_so"."so_state_id" in ($12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25))) OR $26))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $27
7 min 0.4% 173 ms 2,492 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
7 min 0.4% 149 ms 2,840 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
7 min 0.4% 937 ms 442 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_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)) AND (((("asm_so"."service_center_id" in ($1001,$1002,$1003,$1004,$1005,$1006,$1007,$1008,$1009,$1010,$1011,$1012,$1013,$1014,$1015,$1016,$1017,$1018,$1019,$1020,$1021,$1022,$1023,$1024,$1025,$1026,$1027,$1028,$1029,$1030,$1031,$1032,$1033,$1034,$1035,$1036,$1037,$1038,$1039,$1040,$1041,$1042,$1043,$1044,$1045,$1046,$1047,$1048,$1049,$1050,$1051,$1052,$1053,$1054,$1055,$1056,$1057,$1058,$1059,$1060,$1061,$1062,$1063,$1064,$1065,$1066,$1067,$1068,$1069,$1070,$1071,$1072,$1073,$1074,$1075,$1076,$1077,$1078,$1079,$1080,$1081,$1082,$1083,$1084,$1085,$1086,$1087,$1088,$1089,$1090,$1091,$1092,$1093,$1094,$1095)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($1096,$1097,$1098,$1099,$1100,$1101,$1102,$1103,$1104,$1105,$1106,$1107,$1108,$1109,$1110)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($1111,$1112))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
7 min 0.4% 124 ms 3,314 odoo14
SELECT count($1) FROM "asm_sr" WHERE (((("asm_sr"."service_center_id" in ($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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($114,$115)))
7 min 0.4% 116 ms 3,550 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND (((("asm_so"."service_center_id" in ($2)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($3,$4)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($5))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
6 min 0.3% 138 ms 2,744 odoo14
WITH currency_rate AS (
            SELECT
                r.currency_id,
                COALESCE(r.company_id, c.id) as company_id,
                r.rate,
                r.name AS date_start,
                (SELECT name FROM res_currency_rate r2
                 WHERE r2.name > r.name AND
                       r2.currency_id = r.currency_id AND
                       (r2.company_id is null or r2.company_id = c.id)
                 ORDER BY r2.name ASC
                 LIMIT $1) AS date_end
            FROM res_currency_rate r
            JOIN res_company c ON (r.company_id is null or r.company_id = c.id)
        )
                SELECT
                    SUM(
                        l.price_unit / (CASE COALESCE(cr.rate, $2) WHEN $3 THEN $4 ELSE cr.rate END) *
                        l.quantity * (CASE WHEN i.move_type IN ($5, $6) THEN $7 ELSE $8 END) * (($9 - l.discount) * $10)
                    ) / NULLIF(SUM(l.quantity * (CASE WHEN i.move_type IN ($11, $12) THEN $13 ELSE $14 END)), $15) AS avg_unit_price,
                    SUM(l.quantity * (CASE WHEN i.move_type IN ($16, $17) THEN $18 ELSE $19 END)) AS num_qty,
                    SUM(ABS(l.balance) * (CASE WHEN i.move_type IN ($20, $21) THEN $22 ELSE $23 END)) AS total,
                    SUM(l.quantity * pt.list_price * (CASE WHEN i.move_type IN ($24, $25) THEN $26 ELSE $27 END)) AS sale_expected
                FROM account_move_line l
                LEFT JOIN account_move i ON (l.move_id = i.id)
                LEFT JOIN product_product product ON (product.id=l.product_id)
                LEFT JOIN product_template pt ON (pt.id = product.product_tmpl_id)
                left join currency_rate cr on
                (cr.currency_id = i.currency_id and
                 cr.company_id = i.company_id and
                 cr.date_start <= COALESCE(i.invoice_date, NOW()) and
                 (cr.date_end IS NULL OR cr.date_end > COALESCE(i.invoice_date, NOW())))
                WHERE l.product_id = $28
                AND i.state IN ($29)
                AND i.payment_state IN ($30, $31)
                AND i.move_type IN ($32, $33)
                AND i.invoice_date BETWEEN $34 AND  $35
                AND i.company_id = $36
                AND l.display_type IS NULL
                AND l.exclude_from_invoice_tab = $37
6 min 0.3% 170 ms 2,185 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
6 min 0.3% 499 ms 726 odoo14
SELECT min("asm_sr".id) AS id, count("asm_sr".id) AS "sr_state_id_count" , sum("asm_sr"."diff_last_activity_create") AS "diff_last_activity_create",sum("asm_sr"."so_count") AS "so_count","asm_sr"."sr_state_id" as "sr_state_id" 
            FROM "asm_sr" LEFT JOIN "asm_state" AS "asm_sr__sr_state_id" ON ("asm_sr"."sr_state_id" = "asm_sr__sr_state_id"."id") LEFT JOIN "ir_translation" AS "asm_sr__sr_state_id__name" ON ("asm_sr__sr_state_id"."id" = "asm_sr__sr_state_id__name"."res_id" AND "asm_sr__sr_state_id__name"."type" = $1 AND "asm_sr__sr_state_id__name"."name" = $2 AND "asm_sr__sr_state_id__name"."lang" = $3 AND "asm_sr__sr_state_id__name"."value" != $4)
            WHERE (("asm_sr"."sr_type" = $5) AND (("asm_sr"."client_type" = $6) AND ((("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($7)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $8 ) OR ("res_partner"."company_id" in ($9))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $10) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $11))) ORDER BY  "res_partner"."id"  )) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($12)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $13 ) OR ("res_partner"."company_id" in ($14))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $15) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $16))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($17)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $18 ) OR ("res_partner"."company_id" in ($19))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $20) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $21))) ORDER BY  "res_partner"."id"  ))))) AND (((("asm_sr"."service_center_id" in ($22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($35,$36,$37,$38,$39)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($40,$41)))
            GROUP BY "asm_sr"."sr_state_id","asm_sr__sr_state_id"."sequence",COALESCE("asm_sr__sr_state_id__name"."value","asm_sr__sr_state_id"."name"),"asm_sr__sr_state_id"."id"
            ORDER BY  "asm_sr__sr_state_id"."sequence" ,COALESCE("asm_sr__sr_state_id__name"."value", "asm_sr__sr_state_id"."name") ,"asm_sr__sr_state_id"."id"
6 min 0.3% 174 ms 2,060 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
6 min 0.3% 135 ms 2,591 odoo14
SELECT "stock_valuation_layer".id FROM "stock_valuation_layer" WHERE (("stock_valuation_layer"."account_move_id" in ($1)) AND (("stock_valuation_layer"."id" not in ($2)) OR "stock_valuation_layer"."id" IS NULL)) ORDER BY  "stock_valuation_layer"."create_date" ,"stock_valuation_layer"."id"
6 min 0.3% 139 ms 2,507 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND (((("asm_so"."service_center_id" in ($2,$3,$4,$5,$6,$7)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($21,$22))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
6 min 0.3% 129 ms 2,697 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) AND (((("asm_so"."service_center_id" in ($2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($20,$21,$22,$23)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($24,$25))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
6 min 0.3% 557 ms 605 odoo14
SELECT min("asm_sr".id) AS id, count("asm_sr".id) AS "client_type_count" , sum("asm_sr"."diff_last_activity_create") AS "diff_last_activity_create",sum("asm_sr"."so_count") AS "so_count","asm_sr"."client_type" as "client_type" 
            FROM "asm_sr"
            WHERE ((("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($1)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $2 ) OR ("res_partner"."company_id" in ($3))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $4) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $5))) ORDER BY  "res_partner"."id"  )) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($6)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $7 ) OR ("res_partner"."company_id" in ($8))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $9) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $10))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($11)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $12 ) OR ("res_partner"."company_id" in ($13))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $14) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $15))) ORDER BY  "res_partner"."id"  ))) AND (((("asm_sr"."service_center_id" in ($16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($29,$30,$31,$32,$33)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($34,$35)))
            GROUP BY "asm_sr"."client_type"
            ORDER BY "client_type"
            LIMIT $36
6 min 0.3% 1,057 ms 315 odoo14
SELECT min("asm_sr".id) AS id, count("asm_sr".id) AS "sr_state_id_count" , sum("asm_sr"."diff_last_activity_create") AS "diff_last_activity_create",sum("asm_sr"."so_count") AS "so_count","asm_sr"."sr_state_id" as "sr_state_id" 
            FROM "asm_sr" LEFT JOIN "asm_state" AS "asm_sr__sr_state_id" ON ("asm_sr"."sr_state_id" = "asm_sr__sr_state_id"."id") LEFT JOIN "ir_translation" AS "asm_sr__sr_state_id__name" ON ("asm_sr__sr_state_id"."id" = "asm_sr__sr_state_id__name"."res_id" AND "asm_sr__sr_state_id__name"."type" = $1 AND "asm_sr__sr_state_id__name"."name" = $2 AND "asm_sr__sr_state_id__name"."lang" = $3 AND "asm_sr__sr_state_id__name"."value" != $4)
            WHERE ((((((("asm_sr"."create_date" >= $5) AND ((((("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($6)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $7 ) OR ("res_partner"."company_id" in ($8))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $9) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $10))) ORDER BY  "res_partner"."id"  )) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($11)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $12 ) OR ("res_partner"."company_id" in ($13))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $14) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $15))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($16)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $17 ) OR ("res_partner"."company_id" in ($18))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $19) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $20))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($21,$22)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $23 ) OR ("res_partner"."company_id" in ($24))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $25) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $26))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($27)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $28 ) OR ("res_partner"."company_id" in ($29))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $30) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $31))) ORDER BY  "res_partner"."id"  )))) AND (("asm_sr"."sr_type" != $32) OR "asm_sr"."sr_type" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (((("asm_sr"."service_center_id" in ($415,$416,$417,$418,$419,$420,$421,$422)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($423,$424,$425,$426,$427,$428,$429,$430,$431,$432,$433,$434)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($435,$436)))
            GROUP BY "asm_sr"."sr_state_id","asm_sr__sr_state_id"."sequence",COALESCE("asm_sr__sr_state_id__name"."value","asm_sr__sr_state_id"."name"),"asm_sr__sr_state_id"."id"
            ORDER BY  "asm_sr__sr_state_id"."sequence" ,COALESCE("asm_sr__sr_state_id__name"."value", "asm_sr__sr_state_id"."name") ,"asm_sr__sr_state_id"."id"  
            LIMIT $437
6 min 0.3% 177 ms 1,869 odoo14
SELECT "ir_attachment".id FROM "ir_attachment" WHERE ("ir_attachment"."res_field" IS NULL  AND ("ir_attachment"."activity_line_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
5 min 0.3% 139 ms 2,341 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113,$114)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($115,$116))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
5 min 0.3% 129 ms 2,530 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."client_id" = $1) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($113,$114))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $115
5 min 0.3% 529 ms 612 odoo14
SELECT min("asm_sr".id) AS id, count("asm_sr".id) AS "sr_type_count" , sum("asm_sr"."diff_last_activity_create") AS "diff_last_activity_create",sum("asm_sr"."so_count") AS "so_count","asm_sr"."sr_type" as "sr_type" 
            FROM "asm_sr"
            WHERE (("asm_sr"."client_type" = $1) AND ((("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($2)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $3 ) OR ("res_partner"."company_id" in ($4))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $5) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $6))) ORDER BY  "res_partner"."id"  )) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($7)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $8 ) OR ("res_partner"."company_id" in ($9))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $10) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $11))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($12)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $13 ) OR ("res_partner"."company_id" in ($14))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $15) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $16))) ORDER BY  "res_partner"."id"  )))) AND (((("asm_sr"."service_center_id" in ($17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($30,$31,$32,$33,$34)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($35,$36)))
            GROUP BY "asm_sr"."sr_type"
            ORDER BY "sr_type"
5 min 0.3% 227 ms 1,425 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND ((((("asm_so"."service_center_id" in ($2)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($3,$4,$5,$6)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($7))) AND (("asm_so"."person_id" = $8) AND ((("asm_so"."so_state_id" in ($9)) OR ("asm_so"."so_state_id" in ($10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23))) OR $24))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $25
5 min 0.3% 24 ms 13,093 odoo14
SELECT "product_warranty".id FROM "product_warranty" WHERE ("product_warranty"."lot_id" in ($1)) ORDER BY  "product_warranty"."id"
Details
CREATE INDEX CONCURRENTLY ON product_warranty (lot_id)
5 min 0.3% 136 ms 2,318 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."client_id" = $1) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($97,$98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($112,$113))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $114
5 min 0.3% 151 ms 2,086 odoo14
SELECT count($1) FROM "asm_so" WHERE ("asm_so"."so_state_id" = $2) AND (((("asm_so"."service_center_id" in ($3)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($4,$5,$6,$7)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($8)))
5 min 0.3% 160 ms 1,916 odoo14
SELECT "product_product".id FROM "product_product" LEFT JOIN "product_template" AS "product_product__product_tmpl_id" ON ("product_product"."product_tmpl_id" = "product_product__product_tmpl_id"."id") LEFT JOIN "ir_translation" AS "product_product__product_tmpl_id__name" ON ("product_product__product_tmpl_id"."id" = "product_product__product_tmpl_id__name"."res_id" AND "product_product__product_tmpl_id__name"."type" = $1 AND "product_product__product_tmpl_id__name"."name" = $2 AND "product_product__product_tmpl_id__name"."lang" = $3 AND "product_product__product_tmpl_id__name"."value" != $4) WHERE (COALESCE("product_product__product_tmpl_id__name"."value", "product_product__product_tmpl_id"."name") ilike $5 AND (("product_product"."id" not 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,$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,$1001,$1002,$1003,$1004,$1005,$1006,$1007,$1008,$1009,$1010,$1011,$1012,$1013,$1014,$1015,$1016,$1017,$1018,$1019,$1020,$1021,$1022,$1023,$1024,$1025,$1026,$1027,$1028,$1029,$1030,$1031,$1032,$1033,$1034,$1035,$1036,$1037,$1038,$1039,$1040,$1041,$1042,$1043,$1044,$1045,$1046,$1047,$1048,$1049,$1050,$1051,$1052,$1053,$1054,$1055,$1056,$1057,$1058,$1059,$1060,$1061,$1062,$1063,$1064,$1065,$1066,$1067,$1068,$1069,$1070,$1071,$1072,$1073,$1074,$1075,$1076,$1077,$1078,$1079,$1080,$1081,$1082,$1083,$1084,$1085,$1086,$1087,$1088,$1089,$1090,$1091,$1092,$1093,$1094,$1095,$1096,$1097,$1098,$1099,$1100,$1101,$1102,$1103,$1104,$1105,$1106,$1107,$1108,$1109,$1110,$1111,$1112,$1113,$1114,$1115,$1116,$1117,$1118,$1119,$1120,$1121,$1122,$1123,$1124,$1125,$1126,$1127,$1128,$1129,$1130,$1131,$1132,$1133,$1134,$1135,$1136,$1137,$1138,$1139,$1140,$1141,$1142,$1143,$1144,$1145,$1146,$1147,$1148,$1149,$1150,$1151,$1152,$1153,$1154,$1155,$1156,$1157,$1158,$1159,$1160,$1161,$1162,$1163,$1164,$1165,$1166,$1167,$1168,$1169,$1170,$1171,$1172,$1173,$1174,$1175,$1176,$1177,$1178,$1179,$1180,$1181,$1182,$1183,$1184,$1185,$1186,$1187,$1188,$1189,$1190,$1191,$1192,$1193,$1194,$1195,$1196,$1197,$1198,$1199,$1200,$1201,$1202,$1203,$1204,$1205,$1206,$1207,$1208,$1209,$1210,$1211,$1212,$1213,$1214,$1215,$1216,$1217,$1218,$1219,$1220,$1221,$1222,$1223,$1224,$1225,$1226,$1227,$1228,$1229,$1230,$1231,$1232,$1233,$1234,$1235,$1236,$1237,$1238,$1239,$1240,$1241,$1242,$1243,$1244,$1245,$1246,$1247,$1248,$1249,$1250,$1251,$1252,$1253,$1254,$1255,$1256,$1257,$1258,$1259,$1260,$1261,$1262,$1263,$1264,$1265,$1266,$1267,$1268,$1269,$1270,$1271,$1272,$1273,$1274,$1275,$1276,$1277,$1278,$1279,$1280,$1281,$1282,$1283,$1284,$1285,$1286,$1287,$1288,$1289,$1290,$1291,$1292,$1293,$1294,$1295,$1296,$1297,$1298,$1299,$1300,$1301,$1302,$1303,$1304,$1305,$1306,$1307,$1308,$1309,$1310,$1311,$1312,$1313,$1314,$1315,$1316,$1317,$1318,$1319,$1320,$1321,$1322,$1323,$1324,$1325,$1326,$1327,$1328,$1329,$1330,$1331,$1332,$1333,$1334,$1335,$1336,$1337,$1338,$1339,$1340,$1341,$1342,$1343,$1344,$1345,$1346,$1347,$1348,$1349,$1350,$1351,$1352,$1353,$1354,$1355,$1356,$1357,$1358,$1359,$1360,$1361,$1362,$1363,$1364,$1365,$1366,$1367,$1368,$1369,$1370,$1371,$1372,$1373,$1374,$1375,$1376,$1377,$1378,$1379,$1380,$1381,$1382,$1383,$1384,$1385,$1386,$1387,$1388,$1389,$1390,$1391,$1392,$1393,$1394,$1395,$1396,$1397,$1398,$1399,$1400,$1401,$1402,$1403,$1404,$1405,$1406,$1407,$1408,$1409,$1410,$1411,$1412,$1413,$1414,$1415,$1416,$1417,$1418,$1419,$1420,$1421,$1422,$1423,$1424,$1425,$1426,$1427,$1428,$1429,$1430,$1431,$1432,$1433,$1434,$1435,$1436,$1437,$1438,$1439,$1440,$1441,$1442,$1443,$1444,$1445,$1446,$1447,$1448,$1449,$1450,$1451,$1452,$1453,$1454,$1455,$1456,$1457,$1458,$1459,$1460,$1461,$1462,$1463,$1464,$1465,$1466,$1467,$1468,$1469,$1470,$1471,$1472,$1473,$1474,$1475,$1476,$1477,$1478,$1479,$1480,$1481,$1482,$1483,$1484,$1485,$1486,$1487,$1488,$1489,$1490,$1491,$1492,$1493,$1494,$1495,$1496,$1497,$1498,$1499,$1500,$1501,$1502,$1503,$1504,$1505,$1506,$1507,$1508,$1509,$1510,$1511,$1512,$1513,$1514,$1515,$1516,$1517,$1518,$1519,$1520,$1521,$1522,$1523,$1524,$1525,$1526,$1527,$1528,$1529,$1530,$1531,$1532,$1533,$1534,$1535,$1536,$1537,$1538,$1539,$1540,$1541,$1542,$1543,$1544,$1545,$1546,$1547,$1548,$1549,$1550,$1551,$1552,$1553,$1554,$1555,$1556,$1557,$1558,$1559,$1560,$1561,$1562,$1563,$1564,$1565,$1566,$1567,$1568,$1569,$1570,$1571,$1572,$1573,$1574,$1575,$1576,$1577,$1578,$1579,$1580,$1581,$1582,$1583,$1584,$1585,$1586,$1587,$1588,$1589,$1590,$1591,$1592,$1593,$1594,$1595,$1596,$1597,$1598,$1599,$1600,$1601,$1602,$1603,$1604,$1605,$1606,$1607,$1608,$1609,$1610,$1611,$1612,$1613,$1614,$1615,$1616,$1617,$1618,$1619,$1620,$1621,$1622,$1623,$1624,$1625,$1626,$1627,$1628,$1629,$1630,$1631,$1632,$1633,$1634,$1635,$1636,$1637,$1638,$1639,$1640,$1641,$1642,$1643,$1644,$1645,$1646)) OR "product_product"."id" IS NULL)) AND (("product_product__product_tmpl_id"."company_id" in ($1647)) OR "product_product__product_tmpl_id"."company_id" IS NULL ) ORDER BY  "product_product"."default_code" ,COALESCE("product_product__product_tmpl_id__name"."value", "product_product__product_tmpl_id"."name") ,"product_product"."id"
5 min 0.3% 129 ms 2,265 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($1)) AND (((("asm_so"."service_center_id" in ($2,$3,$4,$5,$6,$7,$8,$9)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($22,$23))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
5 min 0.3% 147 ms 1,984 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (("asm_so"."service_center_id" = $1) AND ("asm_so"."so_state_id" = $2)) AND (((("asm_so"."service_center_id" in ($3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($16,$17,$18,$19,$20)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($21))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
5 min 0.2% 115 ms 2,425 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ((((("asm_so"."service_center_id" in ($1)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($2,$3,$4,$5,$6)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($7))) AND (("asm_so"."person_id" = $8) AND ((("asm_so"."so_state_id" in ($9)) OR ("asm_so"."so_state_id" in ($10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23))) OR $24))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $25
5 min 0.2% 138 ms 2,017 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND (((("asm_so"."service_center_id" in ($2,$3,$4,$5,$6,$7,$8,$9)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($22,$23))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
5 min 0.2% 202 ms 1,364 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE ("asm_sr"."name"::text ilike $1) AND (((("asm_sr"."service_center_id" in ($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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113,$114)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($115,$116))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $117
5 min 0.2% 130 ms 2,086 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (("asm_so"."person_id" = $1) AND (("asm_so"."service_center_id" = $2) AND ("asm_so"."so_state_id" = $3))) AND (((("asm_so"."service_center_id" in ($4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($17,$18,$19,$20,$21)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($22))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
5 min 0.2% 127 ms 2,134 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."client_id" = $1) AND (((("asm_so"."service_center_id" in ($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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($114,$115))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $116
4 min 0.2% 113 ms 2,321 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (("asm_so"."so_state_id" = $1) AND ("asm_so"."service_center_id" = $2)) AND (((("asm_so"."service_center_id" in ($3)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($4,$5,$6,$7)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($8))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
4 min 0.2% 118 ms 2,131 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."so_state_id" = $1) AND (((("asm_so"."service_center_id" in ($2)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($3,$4,$5,$6)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($7,$8))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC