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

Duplicate Indexes

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

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

Suggested Indexes

Add indexes to speed up queries.


Details
CREATE INDEX CONCURRENTLY ON asm_signature (sr_id)

to speed up

Total Time Average Time Calls
0 min 1% 61 ms 94 odoo14
SELECT "asm_signature".id FROM "asm_signature" WHERE ("asm_signature"."sr_id" in ($1)) ORDER BY  "asm_signature"."id"

Details
CREATE INDEX CONCURRENTLY ON asm_so (sr_id)

to speed up

Total Time Average Time Calls
0 min 2% 110 ms 94 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 ir_attachment (sr_id)

to speed up

Total Time Average Time Calls
0 min 4% 231 ms 96 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

Slow Queries

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

Explain queries to see where to add indexes.

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