PgHero

Queries

Total Time Average Time Calls
223 min 6% 82 ms 162,853 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($101,$102))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
206 min 5% 481 ms 25,722 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
145 min 4% 242 ms 35,908 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
142 min 4% 75 ms 114,009 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
137 min 4% 161 ms 51,188 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
115 min 3% 82 ms 84,203 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)
104 min 3% 67 ms 93,188 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)
87 min 2% 266 ms 19,527 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
83 min 2% 52 ms 94,541 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)
74 min 2% 72 ms 61,086 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
73 min 2% 374 ms 11,687 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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113,$114,$115)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($116,$117))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $118
67 min 2% 302 ms 13,353 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
58 min 2% 99 ms 35,045 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"
57 min 1% 14 ms 244,506 odoo14
SELECT "asm_so"."id" as "id", "asm_so"."sr_id" as "sr_id", "asm_so"."sr_state_id" as "sr_state_id", "asm_so"."sr_state_type" as "sr_state_type", "asm_so"."so_type" as "so_type", "asm_so"."so_state_id" as "so_state_id", "asm_so"."is_closed" as "is_closed", "asm_so"."is_locked" as "is_locked", "asm_so"."name" as "name", "asm_so"."person_id" as "person_id", "asm_so"."car_id" as "car_id", "asm_so"."client_id" as "client_id", "asm_so"."client_type" as "client_type", "asm_so"."contract_id" as "contract_id", "asm_so"."service_center_id" as "service_center_id", "asm_so"."sr_type" as "sr_type", "asm_so"."pref_date_start" as "pref_date_start", "asm_so"."pref_date_end" as "pref_date_end", "asm_so"."diagnose_id" as "diagnose_id", "asm_so"."diagnose_description" as "diagnose_description", "asm_so"."diagnose_warranty" as "diagnose_warranty", "asm_so"."final_diagnose_id" as "final_diagnose_id", "asm_so"."final_diagnose_description" as "final_diagnose_description", "asm_so"."final_diagnose_warranty" as "final_diagnose_warranty", "asm_so"."scheduled_date" as "scheduled_date", "asm_so"."product_type" as "product_type", "asm_so"."service_to_charge" as "service_to_charge", "asm_so"."product_id" as "product_id", "asm_so"."product_brand" as "product_brand", "asm_so"."product_serial_id" as "product_serial_id", "asm_so"."product_serial_warranty_id" as "product_serial_warranty_id", "asm_so"."product_serial_warranty" as "product_serial_warranty", "asm_so"."current_product_serial_warranty" as "current_product_serial_warranty", "asm_so"."pricelist_id" as "pricelist_id", "asm_so"."invoice_count" as "invoice_count", "asm_so"."delivery_picking_id" as "delivery_picking_id", "asm_so"."pull_type" as "pull_type", "asm_so"."reg_warranty_id" as "reg_warranty_id", "asm_so"."reg_serial" as "reg_serial", "asm_so"."error_return" as "error_return", "asm_so"."error_warranty" as "error_warranty", "asm_so"."last_activity_time" as "last_activity_time", "asm_so"."diff_last_activity_create" as "diff_last_activity_create", "asm_so"."work_description" as "work_description", "asm_so"."related_soo_service_center_id" as "related_soo_service_center_id", "asm_so"."amount_paid" as "amount_paid", "asm_so"."invoice_amounts" as "invoice_amounts", "asm_so"."req_qty" as "req_qty", "asm_so"."waiting_qty" as "waiting_qty", "asm_so"."cancelled_qty" as "cancelled_qty", "asm_so"."rec_qty" as "rec_qty", "asm_so"."diff_qty" as "diff_qty", "asm_so"."installed_qty" as "installed_qty", "asm_so"."to_return_qty" as "to_return_qty", "asm_so"."returned_qty" as "returned_qty", "asm_so"."damaged_qty" as "damaged_qty", "asm_so"."rec_damaged_qty" as "rec_damaged_qty", "asm_so"."not_rec_damaged_qty" as "not_rec_damaged_qty", "asm_so"."req_cost" as "req_cost", "asm_so"."waiting_cost" as "waiting_cost", "asm_so"."cancelled_cost" as "cancelled_cost", "asm_so"."rec_cost" as "rec_cost", "asm_so"."diff_cost" as "diff_cost", "asm_so"."to_return_cost" as "to_return_cost", "asm_so"."returned_cost" as "returned_cost", "asm_so"."damaged_cost" as "damaged_cost", "asm_so"."rec_damaged_cost" as "rec_damaged_cost", "asm_so"."not_rec_damaged_cost" as "not_rec_damaged_cost", "asm_so"."installed_cost" as "installed_cost", "asm_so"."installed_price" as "installed_price", "asm_so"."installed_price_tax_exl" as "installed_price_tax_exl", "asm_so"."service_qty" as "service_qty", "asm_so"."service_price" as "service_price", "asm_so"."order_total_price" as "order_total_price", "asm_so"."message_main_attachment_id" as "message_main_attachment_id", "asm_so"."create_uid" as "create_uid", "asm_so"."create_date" as "create_date", "asm_so"."write_uid" as "write_uid", "asm_so"."write_date" as "write_date" FROM "asm_so" WHERE (((("asm_so"."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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($84,$85,$86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($99,$100))) AND "asm_so".id IN ($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
50 min 1% 205 ms 14,644 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (("asm_so"."so_state_id" = $1) AND ("asm_so"."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"  ))) AND (((("asm_so"."service_center_id" in ($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,$20,$21,$22,$23,$24,$25,$26)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($27,$28))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
43 min 1% 153 ms 16,873 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
42 min 1% 1,021 ms 2,460 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"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($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"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($32)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $33 ) OR ("res_partner"."company_id" in ($34))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $35) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $36))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($37)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $38 ) OR ("res_partner"."company_id" in ($39))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $40) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $41))) ORDER BY  "res_partner"."id"  ))) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)))) AND (((("asm_sr"."service_center_id" in ($424,$425,$426,$427,$428,$429,$430,$431,$432,$433,$434,$435,$436)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($437,$438,$439,$440,$441)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($442,$443)))
            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"
41 min 1% 78 ms 31,546 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
41 min 1% 132 ms 18,669 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($165,$166,$167,$168,$169,$170,$171,$172,$173,$174,$175,$176,$177,$178,$179)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($180,$181))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
39 min 1% 88 ms 26,821 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)
35 min 0.9% 0 ms 9,817,268 odoo14
INSERT INTO "asm_products" ("id", "create_uid", "create_date", "write_uid", "write_date", "location_id", "product_id", "product_uom_id", "product_uom_qty", "so_id", "sr_id") VALUES (nextval($1), $2, (now() at time zone $3), $4, (now() at time zone $5), $6, $7, $8, $9, $10, $11) RETURNING id
34 min 0.9% 94 ms 21,771 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)
34 min 0.9% 79 ms 25,512 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($101,$102))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
31 min 0.8% 866 ms 2,181 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE (("asm_sr"."sr_state_id" = $1) AND (("asm_sr"."sr_type" = $2) AND (("asm_sr"."client_type" = $3) AND ((((((((((("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($4)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $5 ) OR ("res_partner"."company_id" in ($6))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $7) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $8))) ORDER BY  "res_partner"."id"  )) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($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))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($14)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $15 ) OR ("res_partner"."company_id" in ($16))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $17) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $18))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($19)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $20 ) OR ("res_partner"."company_id" in ($21))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $22) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $23))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($24)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $25 ) OR ("res_partner"."company_id" in ($26))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $27) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $28))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($29)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $30 ) OR ("res_partner"."company_id" in ($31))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $32) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $33))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($34)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $35 ) OR ("res_partner"."company_id" in ($36))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $37) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $38))) ORDER BY  "res_partner"."id"  ))) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL))))) AND (((("asm_sr"."service_center_id" in ($421,$422,$423,$424,$425,$426,$427,$428,$429,$430,$431,$432,$433)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($434,$435,$436,$437,$438)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($439,$440))) ORDER BY  "asm_sr"."client_type" ASC,"asm_sr"."call_date" DESC  LIMIT $441
31 min 0.8% 378 ms 4,858 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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113,$114,$115,$116,$117)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($118,$119))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $120
31 min 0.8% 22 ms 83,715 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)
30 min 0.8% 5 ms 386,628 odoo14
SELECT "stock_product_card_view".id FROM "stock_product_card_view" WHERE (("stock_product_card_view"."wizard_id" = $1) AND ("stock_product_card_view"."date" <= $2)) ORDER BY  "stock_product_card_view"."date"
30 min 0.8% 919 ms 1,947 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"  ))) 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"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($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"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($32)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $33 ) OR ("res_partner"."company_id" in ($34))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $35) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $36))) ORDER BY  "res_partner"."id"  ))) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL))) AND (((("asm_sr"."service_center_id" in ($419,$420,$421,$422,$423,$424,$425,$426,$427,$428,$429,$430,$431)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($432,$433,$434,$435,$436)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($437,$438)))
            GROUP BY "asm_sr"."sr_type"
            ORDER BY "sr_type"
29 min 0.8% 0 ms 22,891,220 odoo14
DISCARD ALL
29 min 0.8% 14 ms 121,515 odoo14
SELECT "asm_so"."id" as "id", "asm_so"."sr_id" as "sr_id", "asm_so"."sr_state_id" as "sr_state_id", "asm_so"."sr_state_type" as "sr_state_type", "asm_so"."so_type" as "so_type", "asm_so"."so_state_id" as "so_state_id", "asm_so"."is_closed" as "is_closed", "asm_so"."is_locked" as "is_locked", "asm_so"."name" as "name", "asm_so"."person_id" as "person_id", "asm_so"."car_id" as "car_id", "asm_so"."client_id" as "client_id", "asm_so"."client_type" as "client_type", "asm_so"."contract_id" as "contract_id", "asm_so"."service_center_id" as "service_center_id", "asm_so"."sr_type" as "sr_type", "asm_so"."pref_date_start" as "pref_date_start", "asm_so"."pref_date_end" as "pref_date_end", "asm_so"."diagnose_id" as "diagnose_id", "asm_so"."diagnose_description" as "diagnose_description", "asm_so"."diagnose_warranty" as "diagnose_warranty", "asm_so"."final_diagnose_id" as "final_diagnose_id", "asm_so"."final_diagnose_description" as "final_diagnose_description", "asm_so"."final_diagnose_warranty" as "final_diagnose_warranty", "asm_so"."scheduled_date" as "scheduled_date", "asm_so"."product_type" as "product_type", "asm_so"."service_to_charge" as "service_to_charge", "asm_so"."product_id" as "product_id", "asm_so"."product_brand" as "product_brand", "asm_so"."product_serial_id" as "product_serial_id", "asm_so"."product_serial_warranty_id" as "product_serial_warranty_id", "asm_so"."product_serial_warranty" as "product_serial_warranty", "asm_so"."current_product_serial_warranty" as "current_product_serial_warranty", "asm_so"."pricelist_id" as "pricelist_id", "asm_so"."invoice_count" as "invoice_count", "asm_so"."delivery_picking_id" as "delivery_picking_id", "asm_so"."pull_type" as "pull_type", "asm_so"."reg_warranty_id" as "reg_warranty_id", "asm_so"."reg_serial" as "reg_serial", "asm_so"."error_return" as "error_return", "asm_so"."error_warranty" as "error_warranty", "asm_so"."last_activity_time" as "last_activity_time", "asm_so"."diff_last_activity_create" as "diff_last_activity_create", "asm_so"."work_description" as "work_description", "asm_so"."related_soo_service_center_id" as "related_soo_service_center_id", "asm_so"."amount_paid" as "amount_paid", "asm_so"."invoice_amounts" as "invoice_amounts", "asm_so"."req_qty" as "req_qty", "asm_so"."waiting_qty" as "waiting_qty", "asm_so"."cancelled_qty" as "cancelled_qty", "asm_so"."rec_qty" as "rec_qty", "asm_so"."diff_qty" as "diff_qty", "asm_so"."installed_qty" as "installed_qty", "asm_so"."to_return_qty" as "to_return_qty", "asm_so"."returned_qty" as "returned_qty", "asm_so"."damaged_qty" as "damaged_qty", "asm_so"."rec_damaged_qty" as "rec_damaged_qty", "asm_so"."not_rec_damaged_qty" as "not_rec_damaged_qty", "asm_so"."req_cost" as "req_cost", "asm_so"."waiting_cost" as "waiting_cost", "asm_so"."cancelled_cost" as "cancelled_cost", "asm_so"."rec_cost" as "rec_cost", "asm_so"."diff_cost" as "diff_cost", "asm_so"."to_return_cost" as "to_return_cost", "asm_so"."returned_cost" as "returned_cost", "asm_so"."damaged_cost" as "damaged_cost", "asm_so"."rec_damaged_cost" as "rec_damaged_cost", "asm_so"."not_rec_damaged_cost" as "not_rec_damaged_cost", "asm_so"."installed_cost" as "installed_cost", "asm_so"."installed_price" as "installed_price", "asm_so"."installed_price_tax_exl" as "installed_price_tax_exl", "asm_so"."service_qty" as "service_qty", "asm_so"."service_price" as "service_price", "asm_so"."order_total_price" as "order_total_price", "asm_so"."message_main_attachment_id" as "message_main_attachment_id", "asm_so"."create_uid" as "create_uid", "asm_so"."create_date" as "create_date", "asm_so"."write_uid" as "write_uid", "asm_so"."write_date" as "write_date" FROM "asm_so" WHERE (((("asm_so"."service_center_id" in ($1,$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,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($35,$36))) AND "asm_so".id IN ($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)
28 min 0.7% 92 ms 18,409 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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($85,$86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($100,$101))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $102
28 min 0.7% 132 ms 12,728 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($167,$168,$169,$170,$171,$172,$173,$174,$175,$176,$177,$178,$179,$180,$181)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($182,$183))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
28 min 0.7% 122 ms 13,806 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)))
28 min 0.7% 940 ms 1,775 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"  ))) 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)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $22 ) OR ("res_partner"."company_id" in ($23))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $24) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $25))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($26)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $27 ) OR ("res_partner"."company_id" in ($28))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $29) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $30))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($31)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $32 ) OR ("res_partner"."company_id" in ($33))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $34) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $35))) ORDER BY  "res_partner"."id"  ))) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (("asm_sr"."sr_state_id" in ($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)) OR "asm_sr"."sr_state_id" IS NULL)) AND (((("asm_sr"."service_center_id" in ($418,$419,$420,$421,$422,$423,$424,$425,$426,$427,$428,$429,$430)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($431,$432,$433,$434,$435)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($436,$437)))
            GROUP BY "asm_sr"."client_type"
            ORDER BY "client_type" ASC
            LIMIT $438
25 min 0.7% 74 ms 20,757 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($12,$13,$14,$15)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($16))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
24 min 0.6% 74 ms 19,629 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
23 min 0.6% 76 ms 18,468 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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($101,$102)))
23 min 0.6% 78 ms 17,333 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
22 min 0.6% 235 ms 5,744 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
22 min 0.6% 77 ms 17,408 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE (("asm_so"."person_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
21 min 0.5% 14 ms 90,282 odoo14
SELECT "asm_so"."id" as "id", "asm_so"."sr_id" as "sr_id", "asm_so"."sr_state_id" as "sr_state_id", "asm_so"."sr_state_type" as "sr_state_type", "asm_so"."so_type" as "so_type", "asm_so"."so_state_id" as "so_state_id", "asm_so"."is_closed" as "is_closed", "asm_so"."is_locked" as "is_locked", "asm_so"."name" as "name", "asm_so"."person_id" as "person_id", "asm_so"."car_id" as "car_id", "asm_so"."client_id" as "client_id", "asm_so"."client_type" as "client_type", "asm_so"."contract_id" as "contract_id", "asm_so"."service_center_id" as "service_center_id", "asm_so"."sr_type" as "sr_type", "asm_so"."pref_date_start" as "pref_date_start", "asm_so"."pref_date_end" as "pref_date_end", "asm_so"."diagnose_id" as "diagnose_id", "asm_so"."diagnose_description" as "diagnose_description", "asm_so"."diagnose_warranty" as "diagnose_warranty", "asm_so"."final_diagnose_id" as "final_diagnose_id", "asm_so"."final_diagnose_description" as "final_diagnose_description", "asm_so"."final_diagnose_warranty" as "final_diagnose_warranty", "asm_so"."scheduled_date" as "scheduled_date", "asm_so"."product_type" as "product_type", "asm_so"."service_to_charge" as "service_to_charge", "asm_so"."product_id" as "product_id", "asm_so"."product_brand" as "product_brand", "asm_so"."product_serial_id" as "product_serial_id", "asm_so"."product_serial_warranty_id" as "product_serial_warranty_id", "asm_so"."product_serial_warranty" as "product_serial_warranty", "asm_so"."current_product_serial_warranty" as "current_product_serial_warranty", "asm_so"."pricelist_id" as "pricelist_id", "asm_so"."invoice_count" as "invoice_count", "asm_so"."delivery_picking_id" as "delivery_picking_id", "asm_so"."pull_type" as "pull_type", "asm_so"."reg_warranty_id" as "reg_warranty_id", "asm_so"."reg_serial" as "reg_serial", "asm_so"."error_return" as "error_return", "asm_so"."error_warranty" as "error_warranty", "asm_so"."last_activity_time" as "last_activity_time", "asm_so"."diff_last_activity_create" as "diff_last_activity_create", "asm_so"."work_description" as "work_description", "asm_so"."related_soo_service_center_id" as "related_soo_service_center_id", "asm_so"."amount_paid" as "amount_paid", "asm_so"."invoice_amounts" as "invoice_amounts", "asm_so"."req_qty" as "req_qty", "asm_so"."waiting_qty" as "waiting_qty", "asm_so"."cancelled_qty" as "cancelled_qty", "asm_so"."rec_qty" as "rec_qty", "asm_so"."diff_qty" as "diff_qty", "asm_so"."installed_qty" as "installed_qty", "asm_so"."to_return_qty" as "to_return_qty", "asm_so"."returned_qty" as "returned_qty", "asm_so"."damaged_qty" as "damaged_qty", "asm_so"."rec_damaged_qty" as "rec_damaged_qty", "asm_so"."not_rec_damaged_qty" as "not_rec_damaged_qty", "asm_so"."req_cost" as "req_cost", "asm_so"."waiting_cost" as "waiting_cost", "asm_so"."cancelled_cost" as "cancelled_cost", "asm_so"."rec_cost" as "rec_cost", "asm_so"."diff_cost" as "diff_cost", "asm_so"."to_return_cost" as "to_return_cost", "asm_so"."returned_cost" as "returned_cost", "asm_so"."damaged_cost" as "damaged_cost", "asm_so"."rec_damaged_cost" as "rec_damaged_cost", "asm_so"."not_rec_damaged_cost" as "not_rec_damaged_cost", "asm_so"."installed_cost" as "installed_cost", "asm_so"."installed_price" as "installed_price", "asm_so"."installed_price_tax_exl" as "installed_price_tax_exl", "asm_so"."service_qty" as "service_qty", "asm_so"."service_price" as "service_price", "asm_so"."order_total_price" as "order_total_price", "asm_so"."message_main_attachment_id" as "message_main_attachment_id", "asm_so"."create_uid" as "create_uid", "asm_so"."create_date" as "create_date", "asm_so"."write_uid" as "write_uid", "asm_so"."write_date" as "write_date" FROM "asm_so" WHERE (((("asm_so"."service_center_id" in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($14,$15,$16,$17,$18)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($19))) AND "asm_so".id IN ($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)
20 min 0.5% 85 ms 14,363 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
20 min 0.5% 99 ms 11,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))) ORDER BY  "ir_attachment"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON ir_attachment (activity_line_id)
19 min 0.5% 93 ms 12,619 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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($102,$103))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $104
19 min 0.5% 80 ms 14,582 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101,$102)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($103,$104))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
19 min 0.5% 103 ms 11,160 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)
18 min 0.5% 80 ms 13,538 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
18 min 0.5% 2 ms 536,674 odoo14
SELECT "res_partner"."id" as "id", "res_partner"."name" as "name", "res_partner"."display_name" as "display_name", "res_partner"."date" as "date", "res_partner"."title" as "title", "res_partner"."parent_id" as "parent_id", "res_partner"."ref" as "ref", "res_partner"."lang" as "lang", "res_partner"."tz" as "tz", "res_partner"."vat" as "vat", "res_partner"."website" as "website", "res_partner"."comment" as "comment", "res_partner"."credit_limit" as "credit_limit", "res_partner"."active" as "active", "res_partner"."employee" as "employee", "res_partner"."function" as "function", "res_partner"."type" as "type", "res_partner"."street" as "street", "res_partner"."street2" as "street2", "res_partner"."zip" as "zip", "res_partner"."city" as "city", "res_partner"."state_id" as "state_id", "res_partner"."country_id" as "country_id", "res_partner"."partner_latitude" as "partner_latitude", "res_partner"."partner_longitude" as "partner_longitude", "res_partner"."mobile" as "mobile", "res_partner"."is_company" as "is_company", "res_partner"."industry_id" as "industry_id", "res_partner"."company_id" as "company_id", "res_partner"."color" as "color", "res_partner"."partner_share" as "partner_share", "res_partner"."commercial_partner_id" as "commercial_partner_id", "res_partner"."commercial_company_name" as "commercial_company_name", "res_partner"."company_name" as "company_name", "res_partner"."city_id" as "city_id", "res_partner"."message_main_attachment_id" as "message_main_attachment_id", "res_partner"."email_normalized" as "email_normalized", "res_partner"."message_bounce" as "message_bounce", "res_partner"."email" as "email", "res_partner"."phone" as "phone", "res_partner"."user_id" as "user_id", "res_partner"."calendar_last_notif_ack" as "calendar_last_notif_ack", "res_partner"."phone_sanitized" as "phone_sanitized", "res_partner"."debit_limit" as "debit_limit", "res_partner"."last_time_entries_checked" as "last_time_entries_checked", "res_partner"."invoice_warn" as "invoice_warn", "res_partner"."invoice_warn_msg" as "invoice_warn_msg", "res_partner"."supplier_rank" as "supplier_rank", "res_partner"."customer_rank" as "customer_rank", "res_partner"."team_id" as "team_id", "res_partner"."picking_warn" as "picking_warn", "res_partner"."picking_warn_msg" as "picking_warn_msg", "res_partner"."partner_type" as "partner_type", "res_partner"."purchase_warn" as "purchase_warn", "res_partner"."purchase_warn_msg" as "purchase_warn_msg", "res_partner"."sale_warn" as "sale_warn", "res_partner"."sale_warn_msg" as "sale_warn_msg", "res_partner"."warning_stage" as "warning_stage", "res_partner"."blocking_stage" as "blocking_stage", "res_partner"."active_limit" as "active_limit", "res_partner"."followup_status" as "followup_status", "res_partner"."mobile2" as "mobile2", "res_partner"."create_uid" as "create_uid", "res_partner"."create_date" as "create_date", "res_partner"."write_uid" as "write_uid", "res_partner"."write_date" as "write_date" FROM "res_partner" WHERE "res_partner".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)
18 min 0.5% 100 ms 10,653 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)
16 min 0.4% 4 ms 244,683 odoo14
SELECT "asm_sr"."id" as "id", "asm_sr"."product_type" as "product_type" FROM "asm_sr" WHERE "asm_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)
16 min 0.4% 76 ms 12,654 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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101,$102)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($103,$104)))
16 min 0.4% 97 ms 9,887 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)
16 min 0.4% 99 ms 9,545 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)
16 min 0.4% 103 ms 9,097 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)
15 min 0.4% 72 ms 12,723 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)) 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
15 min 0.4% 107 ms 8,489 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)
15 min 0.4% 97 ms 9,069 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)
14 min 0.4% 80 ms 10,775 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($101,$102))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $103
14 min 0.4% 97 ms 8,800 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)))
14 min 0.4% 108 ms 7,743 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)
14 min 0.4% 74 ms 11,181 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
13 min 0.4% 129 ms 6,246 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($166,$167,$168,$169,$170,$171,$172,$173,$174,$175,$176,$177,$178,$179,$180)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($181,$182))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
13 min 0.3% 0 ms 2,021,550 odoo14
SELECT res_groups_users_rel.uid, res_groups_users_rel.gid FROM res_groups_users_rel, "res_groups" LEFT JOIN "ir_translation" AS "res_groups__name" ON ("res_groups"."id" = "res_groups__name"."res_id" AND "res_groups__name"."type" = $1 AND "res_groups__name"."name" = $2 AND "res_groups__name"."lang" = $3 AND "res_groups__name"."value" != $4)
                    WHERE $5=$6 AND res_groups_users_rel.uid IN ($7) AND res_groups_users_rel.gid = res_groups.id
                     ORDER BY COALESCE("res_groups__name"."value", "res_groups"."name")    OFFSET $8
13 min 0.3% 110 ms 6,996 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)
13 min 0.3% 84 ms 8,976 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($18,$19))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
13 min 0.3% 106 ms 7,069 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)
12 min 0.3% 77 ms 9,756 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($102,$103))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
12 min 0.3% 378 ms 1,942 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"."last_activity_time" >= $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)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $22 ) OR ("res_partner"."company_id" in ($23))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $24) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $25))) ORDER BY  "res_partner"."id"  )))) AND (("asm_sr"."sr_type" != $26) OR "asm_sr"."sr_type" IS NULL)) AND (((("asm_sr"."service_center_id" in ($27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($38,$39,$40,$41,$42)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($43,$44)))
            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 $45
12 min 0.3% 14 ms 51,106 odoo14
SELECT "asm_so"."id" as "id", "asm_so"."sr_id" as "sr_id", "asm_so"."sr_state_id" as "sr_state_id", "asm_so"."sr_state_type" as "sr_state_type", "asm_so"."so_type" as "so_type", "asm_so"."so_state_id" as "so_state_id", "asm_so"."is_closed" as "is_closed", "asm_so"."is_locked" as "is_locked", "asm_so"."name" as "name", "asm_so"."person_id" as "person_id", "asm_so"."car_id" as "car_id", "asm_so"."client_id" as "client_id", "asm_so"."client_type" as "client_type", "asm_so"."contract_id" as "contract_id", "asm_so"."service_center_id" as "service_center_id", "asm_so"."sr_type" as "sr_type", "asm_so"."pref_date_start" as "pref_date_start", "asm_so"."pref_date_end" as "pref_date_end", "asm_so"."diagnose_id" as "diagnose_id", "asm_so"."diagnose_description" as "diagnose_description", "asm_so"."diagnose_warranty" as "diagnose_warranty", "asm_so"."final_diagnose_id" as "final_diagnose_id", "asm_so"."final_diagnose_description" as "final_diagnose_description", "asm_so"."final_diagnose_warranty" as "final_diagnose_warranty", "asm_so"."scheduled_date" as "scheduled_date", "asm_so"."product_type" as "product_type", "asm_so"."service_to_charge" as "service_to_charge", "asm_so"."product_id" as "product_id", "asm_so"."product_brand" as "product_brand", "asm_so"."product_serial_id" as "product_serial_id", "asm_so"."product_serial_warranty_id" as "product_serial_warranty_id", "asm_so"."product_serial_warranty" as "product_serial_warranty", "asm_so"."current_product_serial_warranty" as "current_product_serial_warranty", "asm_so"."pricelist_id" as "pricelist_id", "asm_so"."invoice_count" as "invoice_count", "asm_so"."delivery_picking_id" as "delivery_picking_id", "asm_so"."pull_type" as "pull_type", "asm_so"."reg_warranty_id" as "reg_warranty_id", "asm_so"."reg_serial" as "reg_serial", "asm_so"."error_return" as "error_return", "asm_so"."error_warranty" as "error_warranty", "asm_so"."last_activity_time" as "last_activity_time", "asm_so"."diff_last_activity_create" as "diff_last_activity_create", "asm_so"."work_description" as "work_description", "asm_so"."related_soo_service_center_id" as "related_soo_service_center_id", "asm_so"."amount_paid" as "amount_paid", "asm_so"."invoice_amounts" as "invoice_amounts", "asm_so"."req_qty" as "req_qty", "asm_so"."waiting_qty" as "waiting_qty", "asm_so"."cancelled_qty" as "cancelled_qty", "asm_so"."rec_qty" as "rec_qty", "asm_so"."diff_qty" as "diff_qty", "asm_so"."installed_qty" as "installed_qty", "asm_so"."to_return_qty" as "to_return_qty", "asm_so"."returned_qty" as "returned_qty", "asm_so"."damaged_qty" as "damaged_qty", "asm_so"."rec_damaged_qty" as "rec_damaged_qty", "asm_so"."not_rec_damaged_qty" as "not_rec_damaged_qty", "asm_so"."req_cost" as "req_cost", "asm_so"."waiting_cost" as "waiting_cost", "asm_so"."cancelled_cost" as "cancelled_cost", "asm_so"."rec_cost" as "rec_cost", "asm_so"."diff_cost" as "diff_cost", "asm_so"."to_return_cost" as "to_return_cost", "asm_so"."returned_cost" as "returned_cost", "asm_so"."damaged_cost" as "damaged_cost", "asm_so"."rec_damaged_cost" as "rec_damaged_cost", "asm_so"."not_rec_damaged_cost" as "not_rec_damaged_cost", "asm_so"."installed_cost" as "installed_cost", "asm_so"."installed_price" as "installed_price", "asm_so"."installed_price_tax_exl" as "installed_price_tax_exl", "asm_so"."service_qty" as "service_qty", "asm_so"."service_price" as "service_price", "asm_so"."order_total_price" as "order_total_price", "asm_so"."message_main_attachment_id" as "message_main_attachment_id", "asm_so"."create_uid" as "create_uid", "asm_so"."create_date" as "create_date", "asm_so"."write_uid" as "write_uid", "asm_so"."write_date" as "write_date" 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,$7,$8,$9,$10,$11,$12,$13,$14,$15)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($16))) AND "asm_so".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, $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)
12 min 0.3% 1 ms 548,317 odoo14
SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."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)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $198 ) OR ("res_partner"."company_id" in ($199))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $200) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $201))) ORDER BY  "res_partner"."display_name"
12 min 0.3% 73 ms 9,622 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)))
12 min 0.3% 90 ms 7,717 odoo14
SELECT "stock_production_lot".id FROM "stock_production_lot" WHERE (("stock_production_lot"."product_id" = $1) AND ("stock_production_lot"."name"::text ilike $2)) AND ("stock_production_lot"."company_id" in ($3)) ORDER BY  "stock_production_lot"."id"   LIMIT $4
11 min 0.3% 105 ms 6,507 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)
11 min 0.3% 15 ms 46,123 odoo14
SELECT "asm_so"."id" as "id", "asm_so"."sr_id" as "sr_id", "asm_so"."sr_state_id" as "sr_state_id", "asm_so"."sr_state_type" as "sr_state_type", "asm_so"."so_type" as "so_type", "asm_so"."so_state_id" as "so_state_id", "asm_so"."is_closed" as "is_closed", "asm_so"."is_locked" as "is_locked", "asm_so"."name" as "name", "asm_so"."person_id" as "person_id", "asm_so"."car_id" as "car_id", "asm_so"."client_id" as "client_id", "asm_so"."client_type" as "client_type", "asm_so"."contract_id" as "contract_id", "asm_so"."service_center_id" as "service_center_id", "asm_so"."sr_type" as "sr_type", "asm_so"."pref_date_start" as "pref_date_start", "asm_so"."pref_date_end" as "pref_date_end", "asm_so"."diagnose_id" as "diagnose_id", "asm_so"."diagnose_description" as "diagnose_description", "asm_so"."diagnose_warranty" as "diagnose_warranty", "asm_so"."final_diagnose_id" as "final_diagnose_id", "asm_so"."final_diagnose_description" as "final_diagnose_description", "asm_so"."final_diagnose_warranty" as "final_diagnose_warranty", "asm_so"."scheduled_date" as "scheduled_date", "asm_so"."product_type" as "product_type", "asm_so"."service_to_charge" as "service_to_charge", "asm_so"."product_id" as "product_id", "asm_so"."product_brand" as "product_brand", "asm_so"."product_serial_id" as "product_serial_id", "asm_so"."product_serial_warranty_id" as "product_serial_warranty_id", "asm_so"."product_serial_warranty" as "product_serial_warranty", "asm_so"."current_product_serial_warranty" as "current_product_serial_warranty", "asm_so"."pricelist_id" as "pricelist_id", "asm_so"."invoice_count" as "invoice_count", "asm_so"."delivery_picking_id" as "delivery_picking_id", "asm_so"."pull_type" as "pull_type", "asm_so"."reg_warranty_id" as "reg_warranty_id", "asm_so"."reg_serial" as "reg_serial", "asm_so"."error_return" as "error_return", "asm_so"."error_warranty" as "error_warranty", "asm_so"."last_activity_time" as "last_activity_time", "asm_so"."diff_last_activity_create" as "diff_last_activity_create", "asm_so"."work_description" as "work_description", "asm_so"."related_soo_service_center_id" as "related_soo_service_center_id", "asm_so"."amount_paid" as "amount_paid", "asm_so"."invoice_amounts" as "invoice_amounts", "asm_so"."req_qty" as "req_qty", "asm_so"."waiting_qty" as "waiting_qty", "asm_so"."cancelled_qty" as "cancelled_qty", "asm_so"."rec_qty" as "rec_qty", "asm_so"."diff_qty" as "diff_qty", "asm_so"."installed_qty" as "installed_qty", "asm_so"."to_return_qty" as "to_return_qty", "asm_so"."returned_qty" as "returned_qty", "asm_so"."damaged_qty" as "damaged_qty", "asm_so"."rec_damaged_qty" as "rec_damaged_qty", "asm_so"."not_rec_damaged_qty" as "not_rec_damaged_qty", "asm_so"."req_cost" as "req_cost", "asm_so"."waiting_cost" as "waiting_cost", "asm_so"."cancelled_cost" as "cancelled_cost", "asm_so"."rec_cost" as "rec_cost", "asm_so"."diff_cost" as "diff_cost", "asm_so"."to_return_cost" as "to_return_cost", "asm_so"."returned_cost" as "returned_cost", "asm_so"."damaged_cost" as "damaged_cost", "asm_so"."rec_damaged_cost" as "rec_damaged_cost", "asm_so"."not_rec_damaged_cost" as "not_rec_damaged_cost", "asm_so"."installed_cost" as "installed_cost", "asm_so"."installed_price" as "installed_price", "asm_so"."installed_price_tax_exl" as "installed_price_tax_exl", "asm_so"."service_qty" as "service_qty", "asm_so"."service_price" as "service_price", "asm_so"."order_total_price" as "order_total_price", "asm_so"."message_main_attachment_id" as "message_main_attachment_id", "asm_so"."create_uid" as "create_uid", "asm_so"."create_date" as "create_date", "asm_so"."write_uid" as "write_uid", "asm_so"."write_date" as "write_date" FROM "asm_so" WHERE (((("asm_so"."service_center_id" in ($1,$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))) AND "asm_so".id IN ($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)
11 min 0.3% 104 ms 6,438 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"."so_type" = $5) AND (((("asm_so"."service_center_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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101,$102,$103)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($104,$105)))
            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 $106
11 min 0.3% 91 ms 7,283 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"
11 min 0.3% 357 ms 1,838 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"."sr_state_id" = $1) AND ((("asm_sr"."last_activity_time" >= $2) AND (((("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($3)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $4 ) OR ("res_partner"."company_id" in ($5))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $6) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $7))) ORDER BY  "res_partner"."id"  )) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($8)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $9 ) OR ("res_partner"."company_id" in ($10))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $11) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $12))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($13)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $14 ) OR ("res_partner"."company_id" in ($15))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $16) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $17))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($18)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $19 ) OR ("res_partner"."company_id" in ($20))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $21) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $22))) ORDER BY  "res_partner"."id"  )))) AND (("asm_sr"."sr_type" != $23) OR "asm_sr"."sr_type" IS NULL))) AND (((("asm_sr"."service_center_id" in ($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"."client_type"
            ORDER BY "client_type"
11 min 0.3% 172 ms 3,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))) 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
11 min 0.3% 351 ms 1,815 odoo14
SELECT "asm_sr".id FROM "asm_sr" WHERE (("asm_sr"."client_type" = $1) AND (("asm_sr"."sr_state_id" = $2) AND ((("asm_sr"."last_activity_time" >= $3) AND (((("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($4)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $5 ) OR ("res_partner"."company_id" in ($6))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $7) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $8))) ORDER BY  "res_partner"."id"  )) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($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))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($14)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $15 ) OR ("res_partner"."company_id" in ($16))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $17) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $18))) ORDER BY  "res_partner"."id"  ))) OR ("asm_sr"."client_id" in (SELECT "res_partner".id FROM "res_partner" WHERE ("res_partner"."state_id" in ($19)) AND (((("res_partner"."partner_share" IS NULL or "res_partner"."partner_share" = $20 ) OR ("res_partner"."company_id" in ($21))) OR "res_partner"."company_id" IS NULL ) AND (((("res_partner"."type" != $22) OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) OR ("res_partner"."type" = $23))) ORDER BY  "res_partner"."id"  )))) AND (("asm_sr"."sr_type" != $24) OR "asm_sr"."sr_type" IS NULL)))) AND (((("asm_sr"."service_center_id" in ($25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($36,$37,$38,$39,$40)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($41,$42))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $43
10 min 0.3% 80 ms 7,739 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101,$102)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($103,$104))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC  LIMIT $105
10 min 0.3% 75 ms 7,923 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
10 min 0.3% 199 ms 2,942 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
10 min 0.3% 34 ms 17,239 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
10 min 0.3% 72 ms 8,003 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
10 min 0.3% 2 ms 368,480 odoo14
SELECT "ir_ui_view".id FROM "ir_ui_view" WHERE (("ir_ui_view"."active" = $1) AND ("ir_ui_view"."key" = $2)) ORDER BY  "ir_ui_view"."priority" ,"ir_ui_view"."name" ,"ir_ui_view"."id"   LIMIT $3
Details
CREATE INDEX CONCURRENTLY ON ir_ui_view (key)
9 min 0.2% 91 ms 6,171 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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($101,$102))) ORDER BY  "asm_sr"."call_date" DESC  LIMIT $103
9 min 0.2% 109 ms 5,051 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)
9 min 0.2% 71 ms 7,547 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($12,$13,$14,$15)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($16))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
9 min 0.2% 76 ms 6,956 odoo14
SELECT "asm_so".id FROM "asm_so" WHERE ("asm_so"."sr_id" in ($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
8 min 0.2% 492 ms 1,029 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($1086,$1087,$1088,$1089,$1090,$1091,$1092,$1093,$1094,$1095,$1096,$1097,$1098,$1099)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($1100,$1101))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
8 min 0.2% 153 ms 3,288 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,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($18,$19,$20,$21,$22)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($23)))
            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 $24
8 min 0.2% 109 ms 4,542 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)
8 min 0.2% 16 ms 30,161 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)
8 min 0.2% 14 ms 34,795 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 ((((("product_product"."active" = $5) AND "product_product__product_tmpl_id"."scrap_for_template" IS NULL ) AND ("product_product__product_tmpl_id"."is_product" = $6)) AND COALESCE("product_product__product_tmpl_id__name"."value", "product_product__product_tmpl_id"."name") ilike $7) AND ($8 OR "product_product"."id" IS NULL)) AND (("product_product__product_tmpl_id"."company_id" in ($9)) 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"   LIMIT $10
8 min 0.2% 72 ms 6,726 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
8 min 0.2% 136 ms 3,412 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($168,$169,$170,$171,$172,$173,$174,$175,$176,$177,$178,$179,$180,$181,$182)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($183,$184))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
8 min 0.2% 74 ms 6,182 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)) OR "asm_sr"."service_center_id" IS NULL ) AND (("asm_sr"."contract_id" in ($87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101)) OR "asm_sr"."contract_id" IS NULL )) AND ("asm_sr"."client_type" in ($102,$103)))
8 min 0.2% 82 ms 5,582 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)) OR "asm_so"."service_center_id" IS NULL ) AND (("asm_so"."contract_id" in ($89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101,$102,$103)) OR "asm_so"."contract_id" IS NULL )) AND ("asm_so"."so_type" in ($104,$105))) ORDER BY  "asm_so"."name" DESC,"asm_so"."id" DESC
8 min 0.2% 2 ms 221,930 odoo14
INSERT INTO "mail_message" ("id", "create_uid", "create_date", "write_uid", "write_date", "add_sign", "author_id", "body", "date", "email_from", "is_internal", "message_id", "message_type", "model", "record_name", "reply_to", "res_id", "subject", "subtype_id") VALUES (nextval($1), $2, (now() at time zone $3), $4, (now() at time zone $5), $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) RETURNING id
7 min 0.2% 1 ms 548,323 odoo14
SELECT
                U.partner_id as id,
                CASE WHEN max(B.last_poll) IS NULL THEN $1
                    WHEN age(now() AT TIME ZONE $2, max(B.last_poll)) > interval $3 THEN $4
                    WHEN age(now() AT TIME ZONE $5, max(B.last_presence)) > interval $6 THEN $7
                    ELSE $8
                END as status
            FROM bus_presence B
            RIGHT JOIN res_users U ON B.user_id = U.id
            WHERE U.partner_id IN ($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) AND U.active = $206
         GROUP BY U.partner_id