PgHero

Queries

Total Time Average Time Calls
130,946 min 45% 5,935 ms 1,323,899 odoo
SELECT "stock_move".id FROM "stock_move" LEFT JOIN "stock_picking" as "stock_move__picking_id" ON ("stock_move"."picking_id" = "stock_move__picking_id"."id") WHERE (("stock_move"."scrapped" IS NULL or "stock_move"."scrapped" = $1 )  AND  ("stock_move"."raw_material_production_id" in ($2))) ORDER BY "stock_move__picking_id"."priority" DESC,"stock_move__picking_id"."date" ASC,"stock_move__picking_id"."id" DESC,"stock_move"."sequence" ,"stock_move"."id"
33,303 min 12% 6,130 ms 325,995 odoo
SELECT "stock_move".id FROM "stock_move" LEFT JOIN "stock_picking" as "stock_move__picking_id" ON ("stock_move"."picking_id" = "stock_move__picking_id"."id") WHERE (("stock_move"."scrapped" IS NULL or "stock_move"."scrapped" = $1 )  AND  ("stock_move"."production_id" in ($2))) ORDER BY "stock_move__picking_id"."priority" DESC,"stock_move__picking_id"."date" ASC,"stock_move__picking_id"."id" DESC,"stock_move"."sequence" ,"stock_move"."id"
27,911 min 10% 1,452 ms 1,153,666 odoo
SELECT "queue_job".id FROM "queue_job" WHERE ((("queue_job"."state" = $1)  AND  ("queue_job"."date_created" > $2))  AND  ("queue_job"."name" in ($3,$4,$5,$6,$7))) ORDER BY "queue_job"."date_created"
Covered by index on (name, date_created)
Rows: 2029233
Row progression: 2029233, 112735, 11274

Row estimates
- name (=): 112735
- date_created (>): 202924
- state (=): 507308
- date_created (sort): 3

Existing indexes
- id PRIMARY
- channel
- company_id
- identity_key WHERE ((state)::text = ANY (ARRAY[('pending'::character varying)::text, ('enqueued'::character varying)::text])) AND (identity_key IS NOT NULL)
- name, date_created
- state
- uuid
24,111 min 8% 1,175 ms 1,230,987 odoo
SELECT "queue_job".id FROM "queue_job" WHERE ((("queue_job"."state" = $1)  AND  ("queue_job"."date_created" > $2))  AND  (("queue_job"."name" not in ($3,$4,$5,$6,$7,$8,$9)) OR "queue_job"."name" IS NULL)) ORDER BY "queue_job"."date_created"
7,062 min 2% 4,540 ms 93,332 odoo
SELECT "product_product".id FROM "product_template" as "product_product__product_tmpl_id","product_product" WHERE ("product_product"."product_tmpl_id"="product_product__product_tmpl_id"."id") AND ((("product_product"."active" = $1)  AND  ("product_product__product_tmpl_id"."id" in (WITH temp_irt_current (id, name) as (
                            SELECT ct.id, coalesce(it.value,ct."name")
                            FROM product_template ct
                            LEFT JOIN ir_translation it ON (it.name = $2 and
                                        it.lang = $3 and
                                        it.type = $4 and
                                        it.res_id = ct.id and
                                        it.value != $5)
                            )
                            SELECT id FROM temp_irt_current WHERE name ilike $6 order by name
                            )))  AND  ($7 OR "product_product"."id" IS NULL)) ORDER BY "product_product"."default_code" ,"product_product"."id"   limit $8
6,970 min 2% 94 ms 4,444,145 odoo
SELECT "stock_scrap".id FROM "stock_scrap" WHERE ("stock_scrap"."scrap_ticket_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)) ORDER BY "stock_scrap"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON stock_scrap (scrap_ticket_id)
Rows: 123500
Row progression: 123500, 1

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

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

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- author_id
- mail_activity_type_id
- message_id
- model, res_id
- parent_id
- res_id
- subtype_id
3,650 min 1% 9,030 ms 24,251 odoo
SELECT "stock_move".id FROM "stock_move" LEFT JOIN "stock_picking" as "stock_move__picking_id" ON ("stock_move"."picking_id" = "stock_move__picking_id"."id") WHERE ("stock_move"."sale_line_id" in ($1,$2,$3)) ORDER BY "stock_move__picking_id"."priority" DESC,"stock_move__picking_id"."date" ASC,"stock_move__picking_id"."id" DESC,"stock_move"."sequence" ,"stock_move"."id"
3,271 min 1% 295 ms 665,497 odoo
DELETE FROM stock_move WHERE id IN ($1)
Covered by index on (id)
Rows: 19551702
Row progression: 19551702, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- company_id
- create_date
- created_production_id
- date
- date_expected
- location_id
- name
- origin_returned_move_id
- picking_id, id
- product_id, location_id, location_dest_id, company_id, state
- product_id, location_id, location_dest_id, state
- purchase_line_id
- scrapped
- state
3,122 min 1% 325 ms 575,883 odoo
SELECT "account_invoice".id FROM "account_invoice" WHERE ((("account_invoice"."origin"::text like $1)  AND  ("account_invoice"."company_id" = $2))  AND  ("account_invoice"."type" in ($3,$4))) ORDER BY "account_invoice"."date_invoice" DESC,"account_invoice"."number" DESC,"account_invoice"."id" DESC
2,897 min 1% 200,032 ms 869 odoo
DELETE FROM mrp_product_produce WHERE id IN (9966249, 9966250, 9966251, 9966252, 9966253, 9967548, 9966255, 9966256, 9966257, 9966258, 9966259, 9966260, 9966261, 9966262, 9966263, 9966264, 9966265, 9966266, 9966267, 9966268, 9966269, 9966270, 9966271, 9966272, 9966273, 9966274, 9966275, 9966276, 9966277, 9966278, 9966279, 9966280, 9966281, 9966282, 9966283, 9966284, 9966285, 9966286, 9966287, 9966288, 9966289, 9966290, 9966291, 9966292, 9966293, 9966294, 9966295, 9966296, 9966297, 9966298, 9966299, 9966300, 9966301, 9966302, 9966303, 9965279, 9965280, 9966304, 9966746, 9966747, 9966748, 9966749, 9966750, 9966751, 9966752, 9966753, 9966754, 9966755, 9966756, 9966757, 9966758, 9966759, 9966760, 9966761, 9966762, 9966763, 9966764, 9966765, 9966766, 9966767, 9966768, 9966769, 9966770, 9966771, 9966772, 9966773, 9966774, 9966775, 9966776, 9966777, 9966778, 9966779, 9966780, 9966781, 9966782, 9966783, 9966784, 9966785, 9966786, 9966787, 9966788, 9966789, 9966790, 9966791, 9966792, 9966793, 9966794, 9966795, 9966796, 9966797, 9966798, 9966799, 9966800, 9966801, 9966802, 9966803, 9966804, 9966805, 9966806, 9966807, 9966808, 9966809, 9966810, 9966811, 9966812, 9966813, 9966814, 9966815, 9966816, 9966817, 9966818, 9966819, 9966820, 9966821, 9966822, 9966823, 9966824, 9966825, 9966826, 9966827, 9966828, 9966829, 9966830, 9965281, 9965282, 9965283, 9965284, 9965285, 9965286, 9965287, 9965288, 9965289, 9965290, 9965291, 9965292, 9965293, 9965294, 9965295, 9965296, 9965297, 9965298, 9965299, 9965300, 9965301, 9965302, 9966305, 9965304, 9965305, 9965306, 9965307, 9965308, 9966306, 9965310, 9965311, 9965312, 9965313, 9965314, 9965315, 9965316, 9965317, 9965318, 9965319, 9965320, 9965321, 9965322, 9965323, 9965324, 9965325, 9965326, 9965327, 9965328, 9965329, 9965330, 9965331, 9965332, 9965333, 9965334, 9965335, 9965336, 9965337, 9965338, 9965339, 9965340, 9965341, 9965342, 9965343, 9965344, 9965345, 9965346, 9965347, 9965348, 9965349, 9965350, 9965351, 9965352, 9965353, 9965354, 9965355, 9965356, 9965357, 9965358, 9965359, 9965360, 9965361, 9965362, 9965363, 9965364, 9965365, 9965366, 9965367, 9965368, 9965369, 9965370, 9965371, 9965372, 9965373, 9966307, 9966308, 9966311, 9966316, 9966317, 9966831, 9967549, 9967169, 9967170, 9967171, 9967172, 9967173, 9967174, 9967175, 9967176, 9967177, 9967178, 9967179, 9967180, 9967181, 9967182, 9967183, 9967184, 9967185, 9967186, 9967187, 9967188, 9967189, 9967190, 9967191, 9967192, 9967193, 9967194, 9967195, 9967196, 9967197, 9967198, 9967199, 9967200, 9967201, 9967202, 9967203, 9967204, 9967205, 9967206, 9967207, 9967208, 9967209, 9967210, 9967211, 9967212, 9967213, 9967214, 9967215, 9967216, 9967217, 9967218, 9967219, 9967220, 9967221, 9967222, 9967223, 9967224, 9967225, 9967226, 9967227, 9967228, 9967229, 9967230, 9967231, 9967232, 9967233, 9967234, 9967235, 9967236, 9967237, 9967238, 9967239, 9967240, 9967241, 9967242, 9967243, 9967244, 9965374, 9965375, 9966309, 9966310, 9966312, 9966313, 9966314, 9966315, 9966318, 9966319, 9966320, 9966321, 9966322, 9966323, 9966324, 9966325, 9966326, 9966327, 9966328, 9966329, 9966330, 9966331, 9966332, 9966333, 9966334, 9966335, 9966336, 9966337, 9967550, 9966339, 9966340, 9966341, 9966342, 9966343, 9966344, 9966345, 9966346, 9966347, 9966348, 9966349, 9966350, 9966351, 9966352, 9966353, 9966354, 9966355, 9966356, 9966357, 9966358, 9966359, 9966360, 9966361, 9966362, 9966363, 9966364, 9966365, 9966366, 9966367, 9966368, 9966369, 9966370, 9966371, 9966372, 9966373, 9966374, 9966375, 9966376, 9966377, 9966378, 9966379, 9966380, 9966381, 9966382, 9966383, 9966384, 9966385, 9966386, 9966387, 9966388, 9966389, 9966390, 9966391, 9966392, 9966393, 9966394, 9966395, 9966396, 9966397, 9965376, 9965377, 9965378, 9965379, 9965380, 9965381, 9965382, 9965383, 9965384, 9965385, 9965386, 9965387, 9965388, 9965389, 9965390, 9965391, 9965392, 9965393, 9965394, 9965395, 9965396, 9965397, 9965398, 9965399, 9965400, 9965401, 9965402, 9965403, 9965404, 9965405, 9965406, 9965407, 9965408, 9965409, 9965410, 9965411, 9965412, 9966398, 9965414, 9965415, 9965416, 9965417, 9965418, 9965419, 9965420, 9965421, 9965422, 9965423, 9965424, 9965425, 9965426, 9965427, 9965428, 9965429, 9965430, 9965431, 9965432, 9965433, 9965434, 9965435, 9965436, 9965437, 9965438, 9965439, 9965440, 9965441, 9965442, 9965443, 9965444, 9965445, 9965446, 9965447, 9965448, 9965449, 9965450, 9965451, 9965452, 9965453, 9965454, 9965455, 9965456, 9965457, 9965458, 9965459, 9965460, 9965461, 9965462, 9965463, 9965464, 9965465, 9966399, 9966400, 9965471, 9966401, 9966833, 9966834, 9966835, 9966836, 9966837, 9966838, 9966839, 9966840, 9966841, 9966842, 9966843, 9966844, 9966845, 9966846, 9966847, 9966848, 9966849, 9966850, 9966851, 9966852, 9966853, 9966854, 9966855, 9966856, 9966857, 9966858, 9966859, 9966860, 9966861, 9966862, 9966863, 9966864, 9966865, 9966866, 9966867, 9966868, 9966869, 9966870, 9966871, 9966872, 9966873, 9966874, 9966875, 9966876, 9966877, 9966878, 9966879, 9966880, 9966881, 9966882, 9966883, 9966884, 9966885, 9966886, 9966887, 9966888, 9966889, 9966890, 9966891, 9966892, 9966893, 9966894, 9966895, 9966896, 9966897, 9966898, 9966899, 9966900, 9966901, 9966902, 9966903, 9966904, 9966905, 9966906, 9966907, 9966908, 9966909, 9966910, 9966911, 9966912, 9966913, 9966914, 9965468, 9965469, 9965470, 9965472, 9965473, 9965474, 9965475, 9965476, 9965477, 9965478, 9965479, 9965480, 9965481, 9965482, 9965483, 9965490, 9965491, 9966402, 9966403, 9966404, 9966405, 9966406, 9966407, 9966408, 9966409, 9966410, 9966411, 9966412, 9966413, 9966414, 9966415, 9966416, 9966417, 9966418, 9966419, 9966420, 9966421, 9966422, 9966423, 9966424, 9966425, 9966426, 9966427, 9966428, 9966430, 9966431, 9966432, 9966433, 9966434, 9966435, 9966436, 9966437, 9966438, 9966439, 9966440, 9966441, 9966442, 9966443, 9966444, 9966445, 9966446, 9966447, 9966448, 9966449, 9966450, 9966451, 9966452, 9966453, 9966454, 9966455, 9966456, 9966457, 9966458, 9966459, 9966460, 9966461, 9966462, 9966463, 9966464, 9966465, 9966466, 9966467, 9966468, 9966469, 9966470, 9966471, 9966472, 9966473, 9965484, 9965485, 9965486, 9965487, 9965488, 9965489, 9965492, 9965493, 9965494, 9965495, 9965496, 9965497, 9965498, 9965499, 9965500, 9965501, 9965502, 9965503, 9965504, 9965505, 9965506, 9965509, 9965510, 9965511, 9965512, 9965513, 9965514, 9965515, 9965516, 9965517, 9965518, 9965519, 9965521, 9965522, 9965523, 9965524, 9965525, 9965526, 9965527, 9965528, 9965529, 9965530, 9965531, 9965532, 9965533, 9965534, 9965535, 9965536, 9965537, 9965538, 9965539, 9965540, 9965541, 9965542, 9965543, 9965544, 9965545, 9965546, 9965547, 9965548, 9965549, 9965550, 9965551, 9965552, 9965553, 9965554, 9965555, 9965556, 9965557, 9965558, 9965559, 9965560, 9965561, 9965562, 9965563, 9965564, 9965565, 9965566, 9965567, 9965568, 9965569, 9965570, 9965571, 9965572, 9965573, 9965574, 9965575, 9965576, 9965577, 9965578, 9966429, 9965582, 9965596, 9965597, 9965609, 9965610, 9966474, 9966915, 9967245, 9967402, 9967411, 9967412, 9967413, 9967414, 9967415, 9967416, 9967417, 9967418, 9967419, 9967420, 9967421, 9967422, 9967423, 9967424, 9967425, 9967426, 9967427, 9967428, 9967429, 9967430, 9967431, 9967432, 9967433, 9967434, 9967435, 9967436, 9967437, 9967438, 9967439, 9967440, 9967441, 9967442, 9967443, 9967444, 9967445, 9967446, 9967447, 9967448, 9967449, 9967450, 9967451, 9967452, 9967453, 9967454, 9967455, 9967456, 9967457, 9967458, 9967459, 9967460, 9967461, 9967462, 9967463, 9967464, 9967465, 9967466, 9967467, 9967468, 9967469, 9967470, 9967471, 9967472, 9967473, 9967474, 9967475, 9967476, 9967477, 9967478, 9967479, 9967480, 9967481, 9967482, 9967483, 9967484, 9967485, 9967486, 9965580, 9965581, 9965583, 9965584, 9965585, 9965586, 9965587, 9965588, 9965589, 9965590, 9965591, 9965592, 9965593, 9965594, 9965595, 9966475, 9965599, 9965600, 9965601, 9965602, 9965603, 9965604, 9965605, 9965606, 9965607, 9965608, 9965611, 9965612, 9965613, 9966476, 9965615, 9965616, 9965617, 9965618, 9965619, 9965620, 9965621, 9965622, 9965623, 9965624, 9965625, 9965626, 9965627, 9965628, 9965629, 9965630, 9965631, 9965632, 9965633, 9965634, 9965635, 9965636, 9965637, 9965638, 9965639, 9965640, 9965641, 9965642, 9965643, 9965644, 9965645, 9965646, 9965647, 9965648, 9965649, 9965650, 9965651, 9965652, 9965653, 9965654, 9965655, 9965656, 9965657, 9965658, 9965659, 9965660, 9965661, 9965662, 9965663, 9965664, 9965665, 9965666, 9965667, 9965668, 9965669, 9965670, 9965671, 9965672, 9965673, 9966477, 9966478, 9966485, 9966916, 9966917, 9966918, 9966919, 9966920, 9966921, 9966922, 9966923, 9966924, 9966925, 9966926, 9966927, 9966928, 9966929, 9966930, 9966931, 9966932, 9966933, 9966934, 9966935, 9966936, 9966937, 9966938, 9966939, 9966940, 9966941, 9966942, 9966943, 9966944, 9966945, 9966946, 9966947, 9966948, 9966949, 9966950, 9966951, 9966952, 9966953, 9966954, 9966955, 9966956, 9966957, 9966958, 9966959, 9966960, 9966961, 9966962, 9966963, 9966964, 9966965, 9966966, 9966967, 9966968, 9966969, 9966970, 9966971, 9966972, 9966973, 9966974, 9966975, 9966976)
Covered by index on (id)
Rows: 147744
Row progression: 147744, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
1,752 min 0.6% 100 ms 1,055,193 odoo
SELECT "stock_scrap".id FROM "stock_scrap" WHERE ("stock_scrap"."scrap_ticket_id" in ($1)) ORDER BY "stock_scrap"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON stock_scrap (scrap_ticket_id)
Rows: 123500
Row progression: 123500, 1

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

Existing indexes
- id PRIMARY
- move_id
- product_id
1,666 min 0.6% 194 ms 516,086 odoo
SELECT "order_dispatch".id FROM "order_dispatch" WHERE ("order_dispatch"."state" = $1) ORDER BY "order_dispatch"."create_date" DESC  limit $2
Details
CREATE INDEX CONCURRENTLY ON order_dispatch (state, create_date)
Rows: 109798
Row progression: 109798, 36599, 0

Row estimates
- state (=): 36599
- create_date (sort): 1

Existing indexes
- id PRIMARY
1,666 min 0.6% 8,446 ms 11,836 odoo
SELECT "stock_move".id FROM "stock_move" LEFT JOIN "stock_picking" as "stock_move__picking_id" ON ("stock_move"."picking_id" = "stock_move__picking_id"."id") WHERE ("stock_move"."sale_line_id" in ($1,$2,$3,$4)) ORDER BY "stock_move__picking_id"."priority" DESC,"stock_move__picking_id"."date" ASC,"stock_move__picking_id"."id" DESC,"stock_move"."sequence" ,"stock_move"."id"
1,629 min 0.6% 6,641 ms 14,722 odoo
SELECT distinct("order_id") FROM "sale_order_line" where "order_id" is not null
1,412 min 0.5% 3,915 ms 21,638 odoo
SELECT "queue_job".id FROM "queue_job" WHERE ("queue_job"."date_done" <= $1) ORDER BY "queue_job"."date_created" DESC,"queue_job"."date_done" DESC
Details
CREATE INDEX CONCURRENTLY ON queue_job (date_done)
Rows: 2029233
Row progression: 2029233, 155135

Row estimates
- date_done (<=): 155135
- date_created (sort): 3

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

Row estimates
- id (=): 1

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

Row estimates
- id (=): 1

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

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- move_id
- product_id
588 min 0.2% 30,864 ms 1,144 odoo
SELECT "sale_order".id FROM "sale_order" WHERE (("sale_order"."warehouse_id" = $1)  AND  ("sale_order"."fo_state" = $2)) ORDER BY "sale_order"."date_order" ASC  limit $3
Details
CREATE INDEX CONCURRENTLY ON sale_order (warehouse_id)
Rows: 875351
Row progression: 875351, 35014, 11671

Row estimates
- warehouse_id (=): 35014
- fo_state (=): 291784
- date_order (sort): 1

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

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- name
- state
395 min 0.1% 0 ms 68,717,239 odoo
SELECT "stock_quant".id FROM "stock_quant" WHERE (("stock_quant"."location_id" = $1)  AND  ("stock_quant"."owner_id" IS NULL   AND  ("stock_quant"."package_id" IS NULL   AND  (("stock_quant"."lot_id" = $2)  AND  ("stock_quant"."product_id" = $3))))) ORDER BY removal_date, in_date, id
Covered by index on (lot_id)
Rows: 2922664
Row progression: 2922664, 2

Row estimates
- lot_id (=): 2
- product_id (=): 39
- location_id (=): 58453
- owner_id (null): 2922664
- package_id (null): 2922664
- removal_date (sort): 13
- in_date (sort): 3
- id (sort): 1

Existing indexes
- id PRIMARY
- lot_id
- product_id
318 min 0.1% 9 ms 2,143,440 odoo
INSERT INTO "mail_message" ("id", "date", "email_from", "message_id", "record_name", "res_id", "model", "no_auto_thread", "subject", "subtype_id", "message_type", "reply_to", "author_id", "parent_id", "body", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, (now() at time zone $18), (now() at time zone $19)) RETURNING id
316 min 0.1% 9 ms 2,088,624 odoo
SELECT "ir_model_fields".id FROM "ir_model_fields" WHERE ("ir_model_fields"."ttype" = $1) ORDER BY "ir_model_fields"."name"
Details
CREATE INDEX CONCURRENTLY ON ir_model_fields (ttype, name)
Rows: 8940
Row progression: 8940, 526, 0

Row estimates
- ttype (=): 526
- name (sort): 4

Existing indexes
- id PRIMARY
- complete_name
- model, name UNIQUE
- model_id
- name
- state
269 min < 0.1% 205 ms 78,552 odoo
SELECT "mrp_product_produce_line".id FROM "mrp_product_produce_line" WHERE ("mrp_product_produce_line"."product_produce_id" in ($1)) ORDER BY "mrp_product_produce_line"."id"
Details
CREATE INDEX CONCURRENTLY ON mrp_product_produce_line (product_produce_id)
Rows: 722484
Row progression: 722484, 9

Row estimates
- product_produce_id (=): 9
- id (sort): 1

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

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- move_id
- product_id
217 min < 0.1% 941 ms 13,850 odoo
SELECT "swk_scrap_ticket".id FROM "swk_scrap_ticket" WHERE ("swk_scrap_ticket"."state" = $1) ORDER BY "swk_scrap_ticket"."id" DESC
Details
CREATE INDEX CONCURRENTLY ON swk_scrap_ticket (state, id)
Rows: 126951
Row progression: 126951, 42317, 0

Row estimates
- state (=): 42317
- id (sort): 1

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

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
192 min < 0.1% 22 ms 534,674 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($4)))  AND  (("stock_move__location_id"."parent_left" >= $5)  AND  ("stock_move__location_id"."parent_left" < $6)))  AND  (("stock_move__location_dest_id"."parent_left" < $7)  OR  ("stock_move__location_dest_id"."parent_left" >= $8))) AND ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id") AND (("stock_move"."company_id" IS NULL   OR  ("stock_move"."company_id" in ($9)))  OR  "stock_move__location_dest_id"."company_id" IS NULL )
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
191 min < 0.1% 90,894 ms 126 odoo
SELECT "mail_message".id FROM "mail_message" WHERE (("mail_message"."model" = $1)  AND  ("mail_message"."res_id" in ($2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70,$71,$72,$73,$74,$75,$76,$77,$78,$79,$80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$100,$101,$102,$103,$104,$105,$106,$107,$108,$109,$110,$111,$112,$113,$114,$115,$116,$117,$118,$119,$120,$121,$122,$123,$124,$125,$126,$127,$128,$129,$130,$131,$132,$133,$134,$135,$136,$137,$138,$139,$140,$141,$142,$143,$144,$145,$146,$147,$148,$149,$150,$151,$152,$153,$154,$155,$156,$157,$158,$159,$160,$161,$162,$163,$164,$165,$166,$167,$168,$169,$170,$171,$172,$173,$174,$175,$176,$177,$178,$179,$180,$181,$182,$183,$184,$185,$186,$187,$188,$189,$190,$191,$192,$193,$194,$195,$196,$197,$198,$199,$200,$201,$202,$203,$204,$205,$206,$207,$208,$209,$210,$211,$212,$213,$214,$215,$216,$217,$218,$219,$220,$221,$222,$223,$224,$225,$226,$227,$228,$229,$230,$231,$232,$233,$234,$235,$236,$237,$238,$239,$240,$241,$242,$243,$244,$245,$246,$247,$248,$249,$250,$251,$252,$253,$254,$255,$256,$257,$258,$259,$260,$261,$262,$263,$264,$265,$266,$267,$268,$269,$270,$271,$272,$273,$274,$275,$276,$277,$278,$279,$280,$281,$282,$283,$284,$285,$286,$287,$288,$289,$290,$291,$292,$293,$294,$295,$296,$297,$298,$299,$300,$301,$302,$303,$304,$305,$306,$307,$308,$309,$310,$311,$312,$313,$314,$315,$316,$317,$318,$319,$320,$321,$322,$323,$324,$325,$326,$327,$328,$329,$330,$331,$332,$333,$334,$335,$336,$337,$338,$339,$340,$341,$342,$343,$344,$345,$346,$347,$348,$349,$350,$351,$352,$353,$354,$355,$356,$357,$358,$359,$360,$361,$362,$363,$364,$365,$366,$367,$368,$369,$370,$371,$372,$373,$374,$375,$376,$377,$378,$379,$380,$381,$382,$383,$384,$385,$386,$387,$388,$389,$390,$391,$392,$393,$394,$395,$396,$397,$398,$399,$400,$401,$402,$403,$404,$405,$406,$407,$408,$409,$410,$411,$412,$413,$414,$415,$416,$417,$418,$419,$420,$421,$422,$423,$424,$425,$426,$427,$428,$429,$430,$431,$432,$433,$434,$435,$436,$437,$438,$439,$440,$441,$442,$443,$444,$445,$446,$447,$448,$449,$450,$451,$452,$453,$454,$455,$456,$457,$458,$459,$460,$461,$462,$463,$464,$465,$466,$467,$468,$469,$470,$471,$472,$473,$474,$475,$476,$477,$478,$479,$480,$481,$482,$483,$484,$485,$486,$487,$488,$489,$490,$491,$492,$493,$494,$495,$496,$497,$498,$499,$500,$501,$502,$503,$504,$505,$506,$507,$508,$509,$510,$511,$512,$513,$514,$515,$516,$517,$518,$519,$520,$521,$522,$523,$524,$525,$526,$527,$528,$529,$530,$531,$532,$533,$534,$535,$536,$537,$538,$539,$540,$541,$542,$543,$544,$545,$546,$547,$548,$549,$550,$551,$552,$553,$554,$555,$556,$557,$558,$559,$560,$561,$562,$563,$564,$565,$566,$567,$568,$569,$570,$571,$572,$573,$574,$575,$576,$577,$578,$579,$580,$581,$582,$583,$584,$585,$586,$587,$588,$589,$590,$591,$592,$593,$594,$595,$596,$597,$598,$599,$600,$601,$602,$603,$604,$605,$606,$607,$608,$609,$610,$611,$612,$613,$614,$615,$616,$617,$618,$619,$620,$621,$622,$623,$624,$625,$626,$627,$628,$629,$630,$631,$632,$633,$634,$635,$636,$637,$638,$639,$640,$641,$642,$643,$644,$645,$646,$647,$648,$649,$650,$651,$652,$653,$654,$655,$656,$657,$658,$659,$660,$661,$662,$663,$664,$665,$666,$667,$668,$669,$670,$671,$672,$673,$674,$675,$676,$677,$678,$679,$680,$681,$682,$683,$684,$685,$686,$687,$688,$689,$690,$691,$692,$693,$694,$695,$696,$697,$698,$699,$700,$701,$702,$703,$704,$705,$706,$707,$708,$709,$710,$711,$712,$713,$714,$715,$716,$717,$718,$719,$720,$721,$722,$723,$724,$725,$726,$727,$728,$729,$730,$731,$732,$733,$734,$735,$736,$737,$738,$739,$740,$741,$742,$743,$744,$745,$746,$747,$748,$749,$750,$751,$752,$753,$754,$755,$756,$757,$758,$759,$760,$761,$762,$763,$764,$765,$766,$767,$768,$769,$770,$771,$772,$773,$774,$775,$776,$777,$778,$779,$780,$781,$782,$783,$784,$785,$786,$787,$788,$789,$790,$791,$792,$793,$794,$795,$796,$797,$798,$799,$800,$801,$802,$803,$804,$805,$806,$807,$808,$809,$810,$811,$812,$813,$814,$815,$816,$817,$818,$819,$820,$821,$822,$823,$824,$825,$826,$827,$828,$829,$830,$831,$832,$833,$834,$835,$836,$837,$838,$839,$840,$841,$842,$843,$844,$845,$846,$847,$848,$849,$850,$851,$852,$853,$854,$855,$856,$857,$858,$859,$860,$861,$862,$863,$864,$865,$866,$867,$868,$869,$870,$871,$872,$873,$874,$875,$876,$877,$878,$879,$880,$881,$882,$883,$884,$885,$886,$887,$888,$889,$890,$891,$892,$893,$894,$895,$896,$897,$898,$899,$900,$901,$902,$903,$904,$905,$906,$907,$908,$909,$910,$911,$912,$913,$914,$915,$916,$917,$918,$919,$920,$921,$922,$923,$924,$925,$926,$927,$928,$929,$930,$931,$932,$933,$934,$935,$936,$937,$938,$939,$940,$941,$942,$943,$944,$945,$946,$947,$948,$949,$950,$951,$952,$953,$954,$955,$956,$957,$958,$959,$960,$961,$962,$963,$964,$965,$966,$967,$968,$969,$970,$971,$972,$973,$974,$975,$976,$977,$978,$979,$980,$981,$982,$983,$984,$985,$986,$987,$988,$989,$990,$991,$992,$993,$994,$995,$996,$997,$998,$999,$1000,$1001,$1002,$1003,$1004,$1005,$1006,$1007,$1008,$1009,$1010,$1011,$1012,$1013,$1014,$1015,$1016,$1017,$1018,$1019,$1020,$1021,$1022,$1023,$1024,$1025,$1026,$1027,$1028,$1029,$1030,$1031,$1032,$1033,$1034,$1035,$1036,$1037,$1038,$1039,$1040,$1041,$1042,$1043,$1044,$1045,$1046,$1047,$1048,$1049,$1050,$1051,$1052,$1053,$1054,$1055,$1056,$1057,$1058,$1059,$1060,$1061,$1062,$1063,$1064,$1065,$1066,$1067,$1068,$1069,$1070,$1071,$1072,$1073,$1074,$1075,$1076,$1077,$1078,$1079,$1080,$1081,$1082,$1083,$1084,$1085,$1086,$1087,$1088,$1089,$1090,$1091,$1092,$1093,$1094,$1095,$1096,$1097,$1098,$1099,$1100,$1101,$1102,$1103,$1104,$1105,$1106,$1107,$1108,$1109,$1110,$1111,$1112,$1113,$1114,$1115,$1116,$1117,$1118,$1119,$1120,$1121,$1122,$1123,$1124,$1125,$1126,$1127,$1128,$1129,$1130,$1131,$1132,$1133,$1134,$1135,$1136,$1137,$1138,$1139,$1140,$1141,$1142,$1143,$1144,$1145,$1146,$1147,$1148,$1149,$1150,$1151,$1152,$1153,$1154,$1155,$1156,$1157,$1158,$1159,$1160,$1161,$1162,$1163,$1164,$1165,$1166,$1167,$1168,$1169,$1170,$1171,$1172,$1173,$1174,$1175,$1176,$1177,$1178,$1179,$1180,$1181,$1182,$1183,$1184,$1185,$1186,$1187,$1188,$1189,$1190,$1191,$1192,$1193,$1194,$1195,$1196,$1197,$1198,$1199,$1200,$1201,$1202,$1203,$1204,$1205,$1206,$1207,$1208,$1209,$1210,$1211,$1212,$1213,$1214,$1215,$1216,$1217,$1218,$1219,$1220,$1221,$1222,$1223,$1224,$1225,$1226,$1227,$1228,$1229,$1230,$1231,$1232,$1233,$1234,$1235,$1236,$1237,$1238,$1239,$1240,$1241,$1242,$1243,$1244,$1245,$1246,$1247,$1248,$1249,$1250,$1251,$1252,$1253,$1254,$1255,$1256,$1257,$1258,$1259,$1260,$1261,$1262,$1263,$1264,$1265,$1266,$1267,$1268,$1269,$1270,$1271,$1272,$1273,$1274,$1275,$1276,$1277,$1278,$1279,$1280,$1281,$1282,$1283,$1284,$1285,$1286,$1287,$1288,$1289,$1290,$1291,$1292,$1293,$1294,$1295,$1296,$1297,$1298,$1299,$1300,$1301,$1302,$1303,$1304,$1305,$1306,$1307,$1308,$1309,$1310,$1311,$1312,$1313,$1314,$1315,$1316,$1317,$1318,$1319,$1320,$1321,$1322,$1323,$1324,$1325,$1326,$1327,$1328,$1329,$1330,$1331,$1332,$1333,$1334,$1335,$1336,$1337,$1338,$1339,$1340,$1341,$1342,$1343,$1344,$1345,$1346,$1347,$1348,$1349,$1350,$1351,$1352,$1353,$1354,$1355,$1356,$1357,$1358,$1359,$1360,$1361,$1362,$1363,$1364,$1365,$1366,$1367,$1368,$1369,$1370,$1371,$1372,$1373,$1374,$1375,$1376,$1377,$1378,$1379,$1380,$1381,$1382,$1383,$1384,$1385,$1386,$1387,$1388,$1389,$1390,$1391,$1392,$1393,$1394,$1395,$1396,$1397,$1398,$1399,$1400,$1401,$1402,$1403,$1404,$1405,$1406,$1407,$1408,$1409,$1410,$1411,$1412,$1413,$1414,$1415,$1416,$1417,$1418,$1419,$1420,$1421,$1422,$1423,$1424,$1425,$1426,$1427,$1428,$1429,$1430,$1431,$1432,$1433,$1434,$1435,$1436,$1437,$1438,$1439,$1440,$1441,$1442,$1443,$1444,$1445,$1446,$1447,$1448,$1449,$1450,$1451,$1452,$1453,$1454,$1455,$1456,$1457,$1458,$1459,$1460,$1461,$1462,$1463,$1464,$1465,$1466,$1467,$1468,$1469,$1470,$1471,$1472,$1473,$1474,$1475,$1476,$1477,$1478,$1479,$1480,$1481,$1482,$1483,$1484,$1485,$1486,$1487,$1488,$1489,$1490,$1491,$1492,$1493,$1494,$1495,$1496,$1497,$1498,$1499,$1500,$1501,$1502,$1503,$1504,$1505,$1506,$1507,$1508,$1509,$1510,$1511,$1512,$1513,$1514,$1515,$1516,$1517,$1518,$1519,$1520,$1521,$1522,$1523,$1524,$1525,$1526,$1527,$1528,$1529,$1530,$1531,$1532,$1533,$1534,$1535,$1536,$1537,$1538,$1539,$1540,$1541,$1542,$1543,$1544,$1545,$1546,$1547,$1548,$1549,$1550,$1551,$1552,$1553,$1554,$1555,$1556,$1557,$1558,$1559,$1560,$1561,$1562,$1563,$1564,$1565,$1566,$1567,$1568,$1569,$1570,$1571,$1572,$1573,$1574,$1575,$1576,$1577,$1578,$1579,$1580,$1581,$1582,$1583,$1584,$1585,$1586,$1587,$1588,$1589,$1590,$1591,$1592,$1593,$1594,$1595,$1596,$1597,$1598,$1599,$1600,$1601,$1602,$1603,$1604,$1605,$1606,$1607,$1608,$1609,$1610,$1611,$1612,$1613,$1614,$1615,$1616,$1617,$1618,$1619,$1620,$1621,$1622,$1623,$1624,$1625,$1626,$1627,$1628,$1629,$1630,$1631,$1632,$1633,$1634,$1635,$1636,$1637,$1638,$1639,$1640,$1641,$1642,$1643,$1644,$1645,$1646,$1647,$1648,$1649,$1650,$1651,$1652,$1653,$1654,$1655,$1656,$1657,$1658,$1659,$1660,$1661,$1662,$1663,$1664,$1665,$1666,$1667,$1668,$1669,$1670,$1671,$1672,$1673,$1674,$1675,$1676,$1677,$1678,$1679,$1680,$1681,$1682,$1683,$1684,$1685,$1686,$1687,$1688,$1689,$1690,$1691,$1692,$1693,$1694,$1695,$1696,$1697,$1698,$1699,$1700,$1701,$1702,$1703,$1704,$1705,$1706,$1707,$1708,$1709,$1710,$1711,$1712,$1713,$1714,$1715,$1716,$1717,$1718,$1719,$1720,$1721,$1722,$1723,$1724,$1725,$1726,$1727,$1728,$1729,$1730,$1731,$1732,$1733,$1734,$1735,$1736,$1737,$1738,$1739,$1740,$1741,$1742,$1743,$1744,$1745,$1746,$1747,$1748,$1749,$1750,$1751,$1752,$1753,$1754,$1755,$1756,$1757,$1758,$1759,$1760,$1761,$1762,$1763,$1764,$1765,$1766,$1767,$1768,$1769,$1770,$1771,$1772,$1773,$1774,$1775,$1776,$1777,$1778,$1779,$1780,$1781,$1782,$1783,$1784,$1785,$1786,$1787,$1788,$1789,$1790,$1791,$1792,$1793,$1794,$1795,$1796,$1797,$1798,$1799,$1800,$1801,$1802,$1803,$1804,$1805,$1806,$1807,$1808,$1809,$1810,$1811,$1812,$1813,$1814,$1815,$1816,$1817,$1818,$1819,$1820,$1821,$1822,$1823,$1824,$1825,$1826,$1827,$1828,$1829,$1830,$1831,$1832,$
173 min < 0.1% 3 ms 3,676,146 odoo
UPDATE "stock_move" SET "state"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 19551702
Row progression: 19551702, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- company_id
- create_date
- created_production_id
- date
- date_expected
- location_id
- name
- origin_returned_move_id
- picking_id, id
- product_id, location_id, location_dest_id, company_id, state
- product_id, location_id, location_dest_id, state
- purchase_line_id
- scrapped
- state
171 min < 0.1% 18,291 ms 562 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $609)  AND  ("stock_move__location_id"."parent_left" < $610))  OR  (("stock_move__location_id"."parent_left" >= $611)  AND  ("stock_move__location_id"."parent_left" < $612)))  OR  (("stock_move__location_id"."parent_left" >= $613)  AND  ("stock_move__location_id"."parent_left" < $614)))  OR  (("stock_move__location_id"."parent_left" >= $615)  AND  ("stock_move__location_id"."parent_left" < $616)))  OR  (("stock_move__location_id"."parent_left" >= $617)  AND  ("stock_move__location_id"."parent_left" < $618)))  OR  (("stock_move__location_id"."parent_left" >= $619)  AND  ("stock_move__location_id"."parent_left" < $620)))  OR  (("stock_move__location_id"."parent_left" >= $621)  AND  ("stock_move__location_id"."parent_left" < $622)))  OR  (("stock_move__location_id"."parent_left" >= $623)  AND  ("stock_move__location_id"."parent_left" < $624)))  OR  (("stock_move__location_id"."parent_left" >= $625)  AND  ("stock_move__location_id"."parent_left" < $626)))  OR  (("stock_move__location_id"."parent_left" >= $627)  AND  ("stock_move__location_id"."parent_left" < $628)))  OR  (("stock_move__location_id"."parent_left" >= $629)  AND  ("stock_move__location_id"."parent_left" < $630)))  OR  (("stock_move__location_id"."parent_left" >= $631)  AND  ("stock_move__location_id"."parent_left" < $632)))  OR  (("stock_move__location_id"."parent_left" >= $633)  AND  ("stock_move__location_id"."parent_left" < $634)))  OR  (("stock_move__location_id"."parent_left" >= $635)  AND  ("stock_move__location_id"."parent_left" < $636))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $637)  OR  ("stock_move__location_dest_id"."parent_left" >= $638))  AND  (("stock_move__location_dest_id"."parent_left" < $639)  OR  ("stock_move__location_dest_id"."parent_left" >= $640)))  AND  (("stock_move__location_dest_id"."parent_left" < $641)  OR  ("stock_move__location_dest_id"."parent_left" >= $642)))  AND  (("stock_move__location_dest_id"."parent_left" < $643)  OR  ("stock_move__location_dest_id"."parent_left" >= $644)))  AND  (("stock_move__location_dest_id"."parent_left" < $645)  OR  ("stock_move__location_dest_id"."parent_left" >= $646)))  AND  (("stock_move__location_dest_id"."parent_left" < $647)  OR  ("stock_move__location_dest_id"."parent_left" >= $648)))  AND  (("stock_move__location_dest_id"."parent_left" < $649)  OR  ("stock_move__location_dest_id"."parent_left" >= $650)))  AND  (("stock_move__location_dest_id"."parent_left" < $651)  OR  ("stock_move__location_dest_id"."parent_left" >= $652)))  AND  (("stock_move__location_dest_id"."parent_left" < $653)  OR  ("stock_move__location_dest_id"."parent_left" >= $654)))  AND  (("stock_move__location_dest_id"."parent_left" < $655)  OR  ("stock_move__location_dest_id"."parent_left" >= $656)))  AND  (("stock_move__location_dest_id"."parent_left" < $657)  OR  ("stock_move__location_dest_id"."parent_left" >= $658)))  AND  (("stock_move__location_dest_id"."parent_left" < $659)  OR  ("stock_move__location_dest_id"."parent_left" >= $660)))  AND  (("stock_move__location_dest_id"."parent_left" < $661)  OR  ("stock_move__location_dest_id"."parent_left" >= $662)))  AND  (("stock_move__location_dest_id"."parent_left" < $663)  OR  ("stock_move__location_dest_id"."parent_left" >= $664))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
162 min < 0.1% 48,805 ms 199 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $590)  AND  ("stock_move__location_id"."parent_left" < $591))  OR  (("stock_move__location_id"."parent_left" >= $592)  AND  ("stock_move__location_id"."parent_left" < $593)))  OR  (("stock_move__location_id"."parent_left" >= $594)  AND  ("stock_move__location_id"."parent_left" < $595)))  OR  (("stock_move__location_id"."parent_left" >= $596)  AND  ("stock_move__location_id"."parent_left" < $597)))  OR  (("stock_move__location_id"."parent_left" >= $598)  AND  ("stock_move__location_id"."parent_left" < $599)))  OR  (("stock_move__location_id"."parent_left" >= $600)  AND  ("stock_move__location_id"."parent_left" < $601)))  OR  (("stock_move__location_id"."parent_left" >= $602)  AND  ("stock_move__location_id"."parent_left" < $603)))  OR  (("stock_move__location_id"."parent_left" >= $604)  AND  ("stock_move__location_id"."parent_left" < $605)))  OR  (("stock_move__location_id"."parent_left" >= $606)  AND  ("stock_move__location_id"."parent_left" < $607)))  OR  (("stock_move__location_id"."parent_left" >= $608)  AND  ("stock_move__location_id"."parent_left" < $609)))  OR  (("stock_move__location_id"."parent_left" >= $610)  AND  ("stock_move__location_id"."parent_left" < $611)))  OR  (("stock_move__location_id"."parent_left" >= $612)  AND  ("stock_move__location_id"."parent_left" < $613)))  OR  (("stock_move__location_id"."parent_left" >= $614)  AND  ("stock_move__location_id"."parent_left" < $615)))  OR  (("stock_move__location_id"."parent_left" >= $616)  AND  ("stock_move__location_id"."parent_left" < $617))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $618)  OR  ("stock_move__location_dest_id"."parent_left" >= $619))  AND  (("stock_move__location_dest_id"."parent_left" < $620)  OR  ("stock_move__location_dest_id"."parent_left" >= $621)))  AND  (("stock_move__location_dest_id"."parent_left" < $622)  OR  ("stock_move__location_dest_id"."parent_left" >= $623)))  AND  (("stock_move__location_dest_id"."parent_left" < $624)  OR  ("stock_move__location_dest_id"."parent_left" >= $625)))  AND  (("stock_move__location_dest_id"."parent_left" < $626)  OR  ("stock_move__location_dest_id"."parent_left" >= $627)))  AND  (("stock_move__location_dest_id"."parent_left" < $628)  OR  ("stock_move__location_dest_id"."parent_left" >= $629)))  AND  (("stock_move__location_dest_id"."parent_left" < $630)  OR  ("stock_move__location_dest_id"."parent_left" >= $631)))  AND  (("stock_move__location_dest_id"."parent_left" < $632)  OR  ("stock_move__location_dest_id"."parent_left" >= $633)))  AND  (("stock_move__location_dest_id"."parent_left" < $634)  OR  ("stock_move__location_dest_id"."parent_left" >= $635)))  AND  (("stock_move__location_dest_id"."parent_left" < $636)  OR  ("stock_move__location_dest_id"."parent_left" >= $637)))  AND  (("stock_move__location_dest_id"."parent_left" < $638)  OR  ("stock_move__location_dest_id"."parent_left" >= $639)))  AND  (("stock_move__location_dest_id"."parent_left" < $640)  OR  ("stock_move__location_dest_id"."parent_left" >= $641)))  AND  (("stock_move__location_dest_id"."parent_left" < $642)  OR  ("stock_move__location_dest_id"."parent_left" >= $643)))  AND  (("stock_move__location_dest_id"."parent_left" < $644)  OR  ("stock_move__location_dest_id"."parent_left" >= $645))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
153 min < 0.1% 21,525 ms 427 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ('done','cancel','draft')) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in (1023644,1004893,1004894,1029147,1006438,889236,889239,889242,889278,889310,889350,889369,1006704,889555,889570,1007671,889638,1007674,1007776,981124,889650,1007785,981128,889675,889680,889687,889696,981201,981203,981205,981210,890123,890131,890142,890149,890152,1029834,981255,890165,1029837,1029836,890419,981264,890430,890468,981281,890479,981284,981287,981322,981324,981325,981327,981328,981463,981464,1010202,981488,890979,1030052,890987,981563,981565,981569,981571,981573,981577,892007,981849,982059,982108,1030732,1030734,1030840,982211,1030846,982237,982243,1030851,982245,1030856,1030857,1030852,982343,1030933,900718,901024,1031692,982454,901418,982518,1017680,1017683,902460,1018626,982582,982642,1018677,982656,982694,1029125,983195,983197,1018755,983247,983253,983258,983271,983288,1018788,1018794,983365,983372,983387,983388,983396,983404,1034514,983406,1034516,1034515,1034518,983416,1034519,1034517,983432,1018823,983486,1018844,983638,905268,1018847,1018848,1018849,983646,1018850,983647,983711,983778,983823,1018883,983841,1018922,1018929,1018930,1019052,1019097,1019110,1019128,1019133,1019135,1019136,1019137,1019138,1019145,1019146,767640,1019149,910992,1019159,1019166,1019170,1019177,1019178,1019181,1019183,1019184,1019185,1019186,1019213,1019214,1019329,1019340,1019352,1019367,1019376,1019381,1019446,1019447,1019450,1019493,1019510,1019520,1019524,1019531,1019534,1021881,1021882,1038841,984296,1039562,1021885,1039566,984309,1039565,984324,1039571,1039619,1039821,1039820,1039824,1040080,1040081,1040084,1040089,1040461,1040462,1040463,1021891,1040476,1040477,1043782,1021894,1045218,1045238,1045239,984620,1045824,984795,1050330,1050443,1050507,1050519,985158,985162,985169,985184,985385,1052506,985523,985534,1052538,985677,1052745,985696,985735,1053004,1053006,1053007,985749,985753,985756,985759,1053027,985763,1053030,1053031,985772,1053356,1053358,1053359,1053361,1053579,1053580,1053584,1053587,1053590,985877,985887,1053600,985907,1053692,1053693,986080,986120,986489,986699,986700,986701,986703,986704,979343,986705,986975,986981,987057,987058,987370,987372,987373,987637,987726,979383,988157,979411,988880,989752,990840,991769,878758,878983,878990,979671,879786,879833,879841,926511,993599,993644,993995,879934,994060,880883,880888,881344,881345,979821,979825,979829,979836,979838,881420,881738,881751,881781,979885,994506,930548,881838,881844,994533,994547,882282,882287,994688,994693,994699,994704,994714,994715,882986,883022,995565,1020400,1021470,995892,1021475,1021481,996654,1021483,1021482,1021485,1021486,883071,996881,1021495,1021498,1021499,1021500,1021501,996892,1021508,996896,1021517,1021873,1021874,1021875,1021876,1021877,1021878,1021879,1021880,980438,980435,1021883,1021884,996925,1021886,1021887,1021888,980455,1021890,1021889,1021892,1021893,980457,1021895,980463,1021897,1021896,1021899,1021900,1021901,997835,1021902,1021904,1021905,1021903,980489,885705,1021906,1022151,1022518,1022519,1022520,1022522,1022523,886249,1022525,1022527,1022528,1022529,1022530,1022531,1022532,1022533,1022534,1022535,1022536,1022537,1022538,1022539,1022540,886272,1022542,1022547,1022548,1022551,1022552,886312,1022555,886303,1022541,1022559,1022560,1022561,1022558,1022557,1022695,980547,1022781,1022823,1022868,1022869,1022598,1022922,1022953,886461,1022965,886555,1022970,1022971,1022969,1022973,1022974,1022975,1022976,1023017,1023020,1023021,1023022,1022972,1023024,1023025,1023026,1023027,1023028,1023029,1023067,1023071,980602,1002146,1010150,1012972,1014065,1022060,1022924,1028981,1034228,1045336,1048007,1050107,1050935,1023195,1023205,1023207,1023208,1023261,1023262,1023263,1023265,1023425,1023583,1023587,1023590,887148,1023603,1023604,1023605,980656,1023607,1023609,1023608,1023612,1023616,1023618,1023619,1023620,1023621,980679,980660,980676,1023630,1023631,1023632,1023633,1023636,980694,1023639,1023640,1023645,887342,1023648,1023647,1023655,1023657,1023793,1023794,1023804,1023808,1023814,1023817,887389,1023825,1023849,1023850,1023852,1023920,1024016,999911,1024060,980760,1000097,1024106,1024110,1024111,1024112,1024109,999913,1024260,1024278,1000716,1024280,1024281,1024288,1024290,1024292,1024300,1024316,1024328,1024329,887456,1024331,1024340,1024339,980862,1001036,1024360,1024367,1024384,1024385,980866,1024369,980873,1025274,980881,1026913,1027084,1027103,1027270,1027362,1028061,980892,1028076,1028077,980896,980899,980902,888006,1028133,1028135,1028136,1028138,1028139,1028149,1028150,980924,980925,980931,888068,1028573,1002460,980938,1002668,1028729,888180,888185,1004889,1004890,1004891,1004892)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= 192)  AND  ("stock_move__location_id"."parent_left" < 193))  OR  (("stock_move__location_id"."parent_left" >= 196)  AND  ("stock_move__location_id"."parent_left" < 197)))  OR  (("stock_move__location_id"."parent_left" >= 208)  AND  ("stock_move__location_id"."parent_left" < 209)))  OR  (("stock_move__location_id"."parent_left" >= 220)  AND  ("stock_move__location_id"."parent_left" < 221)))  OR  (("stock_move__location_id"."parent_left" >= 232)  AND  ("stock_move__location_id"."parent_left" < 233)))  OR  (("stock_move__location_id"."parent_left" >= 244)  AND  ("stock_move__location_id"."parent_left" < 245)))  OR  (("stock_move__location_id"."parent_left" >= 412)  AND  ("stock_move__location_id"."parent_left" < 413)))  OR  (("stock_move__location_id"."parent_left" >= 522)  AND  ("stock_move__location_id"."parent_left" < 523)))  OR  (("stock_move__location_id"."parent_left" >= 534)  AND  ("stock_move__location_id"."parent_left" < 535)))  OR  (("stock_move__location_id"."parent_left" >= 546)  AND  ("stock_move__location_id"."parent_left" < 547)))  OR  (("stock_move__location_id"."parent_left" >= 558)  AND  ("stock_move__location_id"."parent_left" < 559)))  OR  (("stock_move__location_id"."parent_left" >= 570)  AND  ("stock_move__location_id"."parent_left" < 571)))  OR  (("stock_move__location_id"."parent_left" >= 594)  AND  ("stock_move__location_id"."parent_left" < 595)))  OR  (("stock_move__location_id"."parent_left" >= 664)  AND  ("stock_move__location_id"."parent_left" < 665))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < 192)  OR  ("stock_move__location_dest_id"."parent_left" >= 193))  AND  (("stock_move__location_dest_id"."parent_left" < 196)  OR  ("stock_move__location_dest_id"."parent_left" >= 197)))  AND  (("stock_move__location_dest_id"."parent_left" < 208)  OR  ("stock_move__location_dest_id"."parent_left" >= 209)))  AND  (("stock_move__location_dest_id"."parent_left" < 220)  OR  ("stock_move__location_dest_id"."parent_left" >= 221)))  AND  (("stock_move__location_dest_id"."parent_left" < 232)  OR  ("stock_move__location_dest_id"."parent_left" >= 233)))  AND  (("stock_move__location_dest_id"."parent_left" < 244)  OR  ("stock_move__location_dest_id"."parent_left" >= 245)))  AND  (("stock_move__location_dest_id"."parent_left" < 412)  OR  ("stock_move__location_dest_id"."parent_left" >= 413)))  AND  (("stock_move__location_dest_id"."parent_left" < 522)  OR  ("stock_move__location_dest_id"."parent_left" >= 523)))  AND  (("stock_move__location_dest_id"."parent_left" < 534)  OR  ("stock_move__location_dest_id"."parent_left" >= 535)))  AND  (("stock_move__location_dest_id"."parent_left" < 546)  OR  ("stock_move__location_dest_id"."parent_left" >= 547)))  AND  (("stock_move__location_dest_id"."parent_left" < 558)  OR  ("stock_move__location_dest_id"."parent_left" >= 559)))  AND  (("stock_move__location_dest_id"."parent_left" < 570)  OR  ("stock_move__location_dest_id"."parent_left" >= 571)))  AND  (("stock_move__location_dest_id"."parent_left" < 594)  OR  ("stock_move__location_dest_id"."parent_left" >= 595)))  AND  (("stock_move__location_dest_id"."parent_left" < 664)  OR  ("stock_move__location_dest_id"."parent_left" >= 665))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
149 min < 0.1% 2 ms 4,034,126 odoo
SELECT "queue_job".id FROM "queue_job" WHERE ("queue_job"."uuid" = $1) ORDER BY "queue_job"."date_created" DESC,"queue_job"."date_done" DESC  limit $2
Covered by index on (uuid)
Rows: 2029233
Row progression: 2029233, 1

Row estimates
- uuid (=): 1
- date_created (sort): 3

Existing indexes
- id PRIMARY
- channel
- company_id
- identity_key WHERE ((state)::text = ANY (ARRAY[('pending'::character varying)::text, ('enqueued'::character varying)::text])) AND (identity_key IS NOT NULL)
- name, date_created
- state
- uuid
149 min < 0.1% 26,850 ms 332 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $606)  AND  ("stock_move__location_id"."parent_left" < $607))  OR  (("stock_move__location_id"."parent_left" >= $608)  AND  ("stock_move__location_id"."parent_left" < $609)))  OR  (("stock_move__location_id"."parent_left" >= $610)  AND  ("stock_move__location_id"."parent_left" < $611)))  OR  (("stock_move__location_id"."parent_left" >= $612)  AND  ("stock_move__location_id"."parent_left" < $613)))  OR  (("stock_move__location_id"."parent_left" >= $614)  AND  ("stock_move__location_id"."parent_left" < $615)))  OR  (("stock_move__location_id"."parent_left" >= $616)  AND  ("stock_move__location_id"."parent_left" < $617)))  OR  (("stock_move__location_id"."parent_left" >= $618)  AND  ("stock_move__location_id"."parent_left" < $619)))  OR  (("stock_move__location_id"."parent_left" >= $620)  AND  ("stock_move__location_id"."parent_left" < $621)))  OR  (("stock_move__location_id"."parent_left" >= $622)  AND  ("stock_move__location_id"."parent_left" < $623)))  OR  (("stock_move__location_id"."parent_left" >= $624)  AND  ("stock_move__location_id"."parent_left" < $625)))  OR  (("stock_move__location_id"."parent_left" >= $626)  AND  ("stock_move__location_id"."parent_left" < $627)))  OR  (("stock_move__location_id"."parent_left" >= $628)  AND  ("stock_move__location_id"."parent_left" < $629)))  OR  (("stock_move__location_id"."parent_left" >= $630)  AND  ("stock_move__location_id"."parent_left" < $631)))  OR  (("stock_move__location_id"."parent_left" >= $632)  AND  ("stock_move__location_id"."parent_left" < $633))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $634)  OR  ("stock_move__location_dest_id"."parent_left" >= $635))  AND  (("stock_move__location_dest_id"."parent_left" < $636)  OR  ("stock_move__location_dest_id"."parent_left" >= $637)))  AND  (("stock_move__location_dest_id"."parent_left" < $638)  OR  ("stock_move__location_dest_id"."parent_left" >= $639)))  AND  (("stock_move__location_dest_id"."parent_left" < $640)  OR  ("stock_move__location_dest_id"."parent_left" >= $641)))  AND  (("stock_move__location_dest_id"."parent_left" < $642)  OR  ("stock_move__location_dest_id"."parent_left" >= $643)))  AND  (("stock_move__location_dest_id"."parent_left" < $644)  OR  ("stock_move__location_dest_id"."parent_left" >= $645)))  AND  (("stock_move__location_dest_id"."parent_left" < $646)  OR  ("stock_move__location_dest_id"."parent_left" >= $647)))  AND  (("stock_move__location_dest_id"."parent_left" < $648)  OR  ("stock_move__location_dest_id"."parent_left" >= $649)))  AND  (("stock_move__location_dest_id"."parent_left" < $650)  OR  ("stock_move__location_dest_id"."parent_left" >= $651)))  AND  (("stock_move__location_dest_id"."parent_left" < $652)  OR  ("stock_move__location_dest_id"."parent_left" >= $653)))  AND  (("stock_move__location_dest_id"."parent_left" < $654)  OR  ("stock_move__location_dest_id"."parent_left" >= $655)))  AND  (("stock_move__location_dest_id"."parent_left" < $656)  OR  ("stock_move__location_dest_id"."parent_left" >= $657)))  AND  (("stock_move__location_dest_id"."parent_left" < $658)  OR  ("stock_move__location_dest_id"."parent_left" >= $659)))  AND  (("stock_move__location_dest_id"."parent_left" < $660)  OR  ("stock_move__location_dest_id"."parent_left" >= $661))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
147 min < 0.1% 31,442 ms 280 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $626)  AND  ("stock_move__location_id"."parent_left" < $627))  OR  (("stock_move__location_id"."parent_left" >= $628)  AND  ("stock_move__location_id"."parent_left" < $629)))  OR  (("stock_move__location_id"."parent_left" >= $630)  AND  ("stock_move__location_id"."parent_left" < $631)))  OR  (("stock_move__location_id"."parent_left" >= $632)  AND  ("stock_move__location_id"."parent_left" < $633)))  OR  (("stock_move__location_id"."parent_left" >= $634)  AND  ("stock_move__location_id"."parent_left" < $635)))  OR  (("stock_move__location_id"."parent_left" >= $636)  AND  ("stock_move__location_id"."parent_left" < $637)))  OR  (("stock_move__location_id"."parent_left" >= $638)  AND  ("stock_move__location_id"."parent_left" < $639)))  OR  (("stock_move__location_id"."parent_left" >= $640)  AND  ("stock_move__location_id"."parent_left" < $641)))  OR  (("stock_move__location_id"."parent_left" >= $642)  AND  ("stock_move__location_id"."parent_left" < $643)))  OR  (("stock_move__location_id"."parent_left" >= $644)  AND  ("stock_move__location_id"."parent_left" < $645)))  OR  (("stock_move__location_id"."parent_left" >= $646)  AND  ("stock_move__location_id"."parent_left" < $647)))  OR  (("stock_move__location_id"."parent_left" >= $648)  AND  ("stock_move__location_id"."parent_left" < $649)))  OR  (("stock_move__location_id"."parent_left" >= $650)  AND  ("stock_move__location_id"."parent_left" < $651)))  OR  (("stock_move__location_id"."parent_left" >= $652)  AND  ("stock_move__location_id"."parent_left" < $653))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $654)  OR  ("stock_move__location_dest_id"."parent_left" >= $655))  AND  (("stock_move__location_dest_id"."parent_left" < $656)  OR  ("stock_move__location_dest_id"."parent_left" >= $657)))  AND  (("stock_move__location_dest_id"."parent_left" < $658)  OR  ("stock_move__location_dest_id"."parent_left" >= $659)))  AND  (("stock_move__location_dest_id"."parent_left" < $660)  OR  ("stock_move__location_dest_id"."parent_left" >= $661)))  AND  (("stock_move__location_dest_id"."parent_left" < $662)  OR  ("stock_move__location_dest_id"."parent_left" >= $663)))  AND  (("stock_move__location_dest_id"."parent_left" < $664)  OR  ("stock_move__location_dest_id"."parent_left" >= $665)))  AND  (("stock_move__location_dest_id"."parent_left" < $666)  OR  ("stock_move__location_dest_id"."parent_left" >= $667)))  AND  (("stock_move__location_dest_id"."parent_left" < $668)  OR  ("stock_move__location_dest_id"."parent_left" >= $669)))  AND  (("stock_move__location_dest_id"."parent_left" < $670)  OR  ("stock_move__location_dest_id"."parent_left" >= $671)))  AND  (("stock_move__location_dest_id"."parent_left" < $672)  OR  ("stock_move__location_dest_id"."parent_left" >= $673)))  AND  (("stock_move__location_dest_id"."parent_left" < $674)  OR  ("stock_move__location_dest_id"."parent_left" >= $675)))  AND  (("stock_move__location_dest_id"."parent_left" < $676)  OR  ("stock_move__location_dest_id"."parent_left" >= $677)))  AND  (("stock_move__location_dest_id"."parent_left" < $678)  OR  ("stock_move__location_dest_id"."parent_left" >= $679)))  AND  (("stock_move__location_dest_id"."parent_left" < $680)  OR  ("stock_move__location_dest_id"."parent_left" >= $681))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
142 min < 0.1% 34,304 ms 248 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $592)  AND  ("stock_move__location_id"."parent_left" < $593))  OR  (("stock_move__location_id"."parent_left" >= $594)  AND  ("stock_move__location_id"."parent_left" < $595)))  OR  (("stock_move__location_id"."parent_left" >= $596)  AND  ("stock_move__location_id"."parent_left" < $597)))  OR  (("stock_move__location_id"."parent_left" >= $598)  AND  ("stock_move__location_id"."parent_left" < $599)))  OR  (("stock_move__location_id"."parent_left" >= $600)  AND  ("stock_move__location_id"."parent_left" < $601)))  OR  (("stock_move__location_id"."parent_left" >= $602)  AND  ("stock_move__location_id"."parent_left" < $603)))  OR  (("stock_move__location_id"."parent_left" >= $604)  AND  ("stock_move__location_id"."parent_left" < $605)))  OR  (("stock_move__location_id"."parent_left" >= $606)  AND  ("stock_move__location_id"."parent_left" < $607)))  OR  (("stock_move__location_id"."parent_left" >= $608)  AND  ("stock_move__location_id"."parent_left" < $609)))  OR  (("stock_move__location_id"."parent_left" >= $610)  AND  ("stock_move__location_id"."parent_left" < $611)))  OR  (("stock_move__location_id"."parent_left" >= $612)  AND  ("stock_move__location_id"."parent_left" < $613)))  OR  (("stock_move__location_id"."parent_left" >= $614)  AND  ("stock_move__location_id"."parent_left" < $615)))  OR  (("stock_move__location_id"."parent_left" >= $616)  AND  ("stock_move__location_id"."parent_left" < $617)))  OR  (("stock_move__location_id"."parent_left" >= $618)  AND  ("stock_move__location_id"."parent_left" < $619))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $620)  OR  ("stock_move__location_dest_id"."parent_left" >= $621))  AND  (("stock_move__location_dest_id"."parent_left" < $622)  OR  ("stock_move__location_dest_id"."parent_left" >= $623)))  AND  (("stock_move__location_dest_id"."parent_left" < $624)  OR  ("stock_move__location_dest_id"."parent_left" >= $625)))  AND  (("stock_move__location_dest_id"."parent_left" < $626)  OR  ("stock_move__location_dest_id"."parent_left" >= $627)))  AND  (("stock_move__location_dest_id"."parent_left" < $628)  OR  ("stock_move__location_dest_id"."parent_left" >= $629)))  AND  (("stock_move__location_dest_id"."parent_left" < $630)  OR  ("stock_move__location_dest_id"."parent_left" >= $631)))  AND  (("stock_move__location_dest_id"."parent_left" < $632)  OR  ("stock_move__location_dest_id"."parent_left" >= $633)))  AND  (("stock_move__location_dest_id"."parent_left" < $634)  OR  ("stock_move__location_dest_id"."parent_left" >= $635)))  AND  (("stock_move__location_dest_id"."parent_left" < $636)  OR  ("stock_move__location_dest_id"."parent_left" >= $637)))  AND  (("stock_move__location_dest_id"."parent_left" < $638)  OR  ("stock_move__location_dest_id"."parent_left" >= $639)))  AND  (("stock_move__location_dest_id"."parent_left" < $640)  OR  ("stock_move__location_dest_id"."parent_left" >= $641)))  AND  (("stock_move__location_dest_id"."parent_left" < $642)  OR  ("stock_move__location_dest_id"."parent_left" >= $643)))  AND  (("stock_move__location_dest_id"."parent_left" < $644)  OR  ("stock_move__location_dest_id"."parent_left" >= $645)))  AND  (("stock_move__location_dest_id"."parent_left" < $646)  OR  ("stock_move__location_dest_id"."parent_left" >= $647))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
141 min < 0.1% 9 ms 896,770 odoo
INSERT INTO "mail_message" ("id", "model", "parent_id", "body", "reply_to", "author_id", "subtype_id", "subject", "res_id", "date", "record_name", "message_type", "message_id", "email_from", "no_auto_thread", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, (now() at time zone $18), (now() at time zone $19)) RETURNING id
133 min < 0.1% 44,691 ms 179 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $921)  AND  ("stock_move__location_id"."parent_left" < $922))  OR  (("stock_move__location_id"."parent_left" >= $923)  AND  ("stock_move__location_id"."parent_left" < $924)))  OR  (("stock_move__location_id"."parent_left" >= $925)  AND  ("stock_move__location_id"."parent_left" < $926)))  OR  (("stock_move__location_id"."parent_left" >= $927)  AND  ("stock_move__location_id"."parent_left" < $928)))  OR  (("stock_move__location_id"."parent_left" >= $929)  AND  ("stock_move__location_id"."parent_left" < $930)))  OR  (("stock_move__location_id"."parent_left" >= $931)  AND  ("stock_move__location_id"."parent_left" < $932)))  OR  (("stock_move__location_id"."parent_left" >= $933)  AND  ("stock_move__location_id"."parent_left" < $934)))  OR  (("stock_move__location_id"."parent_left" >= $935)  AND  ("stock_move__location_id"."parent_left" < $936)))  OR  (("stock_move__location_id"."parent_left" >= $937)  AND  ("stock_move__location_id"."parent_left" < $938)))  OR  (("stock_move__location_id"."parent_left" >= $939)  AND  ("stock_move__location_id"."parent_left" < $940)))  OR  (("stock_move__location_id"."parent_left" >= $941)  AND  ("stock_move__location_id"."parent_left" < $942)))  OR  (("stock_move__location_id"."parent_left" >= $943)  AND  ("stock_move__location_id"."parent_left" < $944)))  OR  (("stock_move__location_id"."parent_left" >= $945)  AND  ("stock_move__location_id"."parent_left" < $946)))  OR  (("stock_move__location_id"."parent_left" >= $947)  AND  ("stock_move__location_id"."parent_left" < $948))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $949)  OR  ("stock_move__location_dest_id"."parent_left" >= $950))  AND  (("stock_move__location_dest_id"."parent_left" < $951)  OR  ("stock_move__location_dest_id"."parent_left" >= $952)))  AND  (("stock_move__location_dest_id"."parent_left" < $953)  OR  ("stock_move__location_dest_id"."parent_left" >= $954)))  AND  (("stock_move__location_dest_id"."parent_left" < $955)  OR  ("stock_move__location_dest_id"."parent_left" >= $956)))  AND  (("stock_move__location_dest_id"."parent_left" < $957)  OR  ("stock_move__location_dest_id"."parent_left" >= $958)))  AND  (("stock_move__location_dest_id"."parent_left" < $959)  OR  ("stock_move__location_dest_id"."parent_left" >= $960)))  AND  (("stock_move__location_dest_id"."parent_left" < $961)  OR  ("stock_move__location_dest_id"."parent_left" >= $962)))  AND  (("stock_move__location_dest_id"."parent_left" < $963)  OR  ("stock_move__location_dest_id"."parent_left" >= $964)))  AND  (("stock_move__location_dest_id"."parent_left" < $965)  OR  ("stock_move__location_dest_id"."parent_left" >= $966)))  AND  (("stock_move__location_dest_id"."parent_left" < $967)  OR  ("stock_move__location_dest_id"."parent_left" >= $968)))  AND  (("stock_move__location_dest_id"."parent_left" < $969)  OR  ("stock_move__location_dest_id"."parent_left" >= $970)))  AND  (("stock_move__location_dest_id"."parent_left" < $971)  OR  ("stock_move__location_dest_id"."parent_left" >= $972)))  AND  (("stock_move__location_dest_id"."parent_left" < $973)  OR  ("stock_move__location_dest_id"."parent_left" >= $974)))  AND  (("stock_move__location_dest_id"."parent_left" < $975)  OR  ("stock_move__location_dest_id"."parent_left" >= $976))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
129 min < 0.1% 83 ms 93,332 odoo
SELECT "product_product".id FROM "product_product" WHERE (("product_product"."active" = $1)  AND  ("product_product"."default_code"::text ilike $2)) ORDER BY "product_product"."default_code" ,"product_product"."id"   limit $3
126 min < 0.1% 42,002 ms 180 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_dest_id"."parent_left" >= $921)  AND  ("stock_move__location_dest_id"."parent_left" < $922))  OR  (("stock_move__location_dest_id"."parent_left" >= $923)  AND  ("stock_move__location_dest_id"."parent_left" < $924)))  OR  ("stock_move"."location_dest_id" in ($925))))  AND  (((("stock_move__location_id"."parent_left" < $926)  OR  ("stock_move__location_id"."parent_left" >= $927))  AND  (("stock_move__location_id"."parent_left" < $928)  OR  ("stock_move__location_id"."parent_left" >= $929)))  AND  (NOT (("stock_move"."location_id" in ($930))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
126 min < 0.1% 4 ms 1,898,143 odoo
SELECT "mrp_bom".id FROM "mrp_bom" LEFT JOIN "product_product" as "mrp_bom__product_id" ON ("mrp_bom"."product_id" = "mrp_bom__product_id"."id") WHERE ((("mrp_bom"."active" = $1)  AND  (("mrp_bom"."product_id" = $2)  OR  ("mrp_bom"."product_id" IS NULL   AND  ("mrp_bom"."product_tmpl_id" = $3))))  AND  ("mrp_bom"."company_id" = $4)) ORDER BY "mrp_bom"."sequence" ,"mrp_bom__product_id"."default_code" ,"mrp_bom__product_id"."id"   limit $5
125 min < 0.1% 4 ms 2,088,565 odoo
SELECT "ir_model_fields".id FROM "ir_model_fields" WHERE ("ir_model_fields"."relation" = $1) ORDER BY "ir_model_fields"."name"
Details
CREATE INDEX CONCURRENTLY ON ir_model_fields (relation)
Rows: 8940
Row progression: 8940, 11

Row estimates
- relation (=): 11
- name (sort): 4

Existing indexes
- id PRIMARY
- complete_name
- model, name UNIQUE
- model_id
- name
- state
122 min < 0.1% 0 ms 199,603,221 odoo
SELECT id FROM "product_category" WHERE id IN ($1)
121 min < 0.1% 12,274 ms 593 odoo
SELECT min("mrp_production".id) AS id, count("mrp_production".id) AS "picking_type_id_count" , "mrp_production"."picking_type_id" as "picking_type_id" 
            FROM "mrp_production" LEFT JOIN "stock_picking_type" as "mrp_production__picking_type_id" ON ("mrp_production"."picking_type_id" = "mrp_production__picking_type_id"."id")
            WHERE (((("mrp_production"."date_planned_start" < $1)  AND  ("mrp_production"."state" = $2))  AND  (("mrp_production"."state" not in ($3,$4)) OR "mrp_production"."state" IS NULL))  AND  ("mrp_production"."picking_type_id" in ($5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43))) AND (("mrp_production"."company_id" in ($44))  OR  "mrp_production"."company_id" IS NULL )
            GROUP BY "mrp_production"."picking_type_id","mrp_production__picking_type_id"."sequence","mrp_production__picking_type_id"."id"
            ORDER BY  "mrp_production__picking_type_id"."sequence" ,"mrp_production__picking_type_id"."id"
121 min < 0.1% 406 ms 17,815 odoo
SELECT "sale_order".id FROM "sale_order" WHERE ((("sale_order"."partner_id" = $1)  AND  ("sale_order"."brand_id" = $2))  AND  ("sale_order"."create_date" < $3)) ORDER BY "sale_order"."date_order" DESC,"sale_order"."id" DESC  limit $4
Covered by index on (partner_id)
Rows: 875351
Row progression: 875351, 9

Row estimates
- partner_id (=): 9
- brand_id (=): 11671
- create_date (<): 87535
- date_order (sort): 1

Existing indexes
- id PRIMARY
- brand_id
- code
- confirmation_date
- create_date
- date_order
- deliverect_id UNIQUE
- dh_token UNIQUE
- fo_state
- instashop_id UNIQUE
- name
- partner_id
- platform_id
- state
- user_id
- zomato_id UNIQUE
120 min < 0.1% 29,274 ms 246 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $622)  AND  ("stock_move__location_id"."parent_left" < $623))  OR  (("stock_move__location_id"."parent_left" >= $624)  AND  ("stock_move__location_id"."parent_left" < $625)))  OR  (("stock_move__location_id"."parent_left" >= $626)  AND  ("stock_move__location_id"."parent_left" < $627)))  OR  (("stock_move__location_id"."parent_left" >= $628)  AND  ("stock_move__location_id"."parent_left" < $629)))  OR  (("stock_move__location_id"."parent_left" >= $630)  AND  ("stock_move__location_id"."parent_left" < $631)))  OR  (("stock_move__location_id"."parent_left" >= $632)  AND  ("stock_move__location_id"."parent_left" < $633)))  OR  (("stock_move__location_id"."parent_left" >= $634)  AND  ("stock_move__location_id"."parent_left" < $635)))  OR  (("stock_move__location_id"."parent_left" >= $636)  AND  ("stock_move__location_id"."parent_left" < $637)))  OR  (("stock_move__location_id"."parent_left" >= $638)  AND  ("stock_move__location_id"."parent_left" < $639)))  OR  (("stock_move__location_id"."parent_left" >= $640)  AND  ("stock_move__location_id"."parent_left" < $641)))  OR  (("stock_move__location_id"."parent_left" >= $642)  AND  ("stock_move__location_id"."parent_left" < $643)))  OR  (("stock_move__location_id"."parent_left" >= $644)  AND  ("stock_move__location_id"."parent_left" < $645)))  OR  (("stock_move__location_id"."parent_left" >= $646)  AND  ("stock_move__location_id"."parent_left" < $647)))  OR  (("stock_move__location_id"."parent_left" >= $648)  AND  ("stock_move__location_id"."parent_left" < $649))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $650)  OR  ("stock_move__location_dest_id"."parent_left" >= $651))  AND  (("stock_move__location_dest_id"."parent_left" < $652)  OR  ("stock_move__location_dest_id"."parent_left" >= $653)))  AND  (("stock_move__location_dest_id"."parent_left" < $654)  OR  ("stock_move__location_dest_id"."parent_left" >= $655)))  AND  (("stock_move__location_dest_id"."parent_left" < $656)  OR  ("stock_move__location_dest_id"."parent_left" >= $657)))  AND  (("stock_move__location_dest_id"."parent_left" < $658)  OR  ("stock_move__location_dest_id"."parent_left" >= $659)))  AND  (("stock_move__location_dest_id"."parent_left" < $660)  OR  ("stock_move__location_dest_id"."parent_left" >= $661)))  AND  (("stock_move__location_dest_id"."parent_left" < $662)  OR  ("stock_move__location_dest_id"."parent_left" >= $663)))  AND  (("stock_move__location_dest_id"."parent_left" < $664)  OR  ("stock_move__location_dest_id"."parent_left" >= $665)))  AND  (("stock_move__location_dest_id"."parent_left" < $666)  OR  ("stock_move__location_dest_id"."parent_left" >= $667)))  AND  (("stock_move__location_dest_id"."parent_left" < $668)  OR  ("stock_move__location_dest_id"."parent_left" >= $669)))  AND  (("stock_move__location_dest_id"."parent_left" < $670)  OR  ("stock_move__location_dest_id"."parent_left" >= $671)))  AND  (("stock_move__location_dest_id"."parent_left" < $672)  OR  ("stock_move__location_dest_id"."parent_left" >= $673)))  AND  (("stock_move__location_dest_id"."parent_left" < $674)  OR  ("stock_move__location_dest_id"."parent_left" >= $675)))  AND  (("stock_move__location_dest_id"."parent_left" < $676)  OR  ("stock_move__location_dest_id"."parent_left" >= $677))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
118 min < 0.1% 14,719 ms 482 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_dest_id"."parent_left" >= $610)  AND  ("stock_move__location_dest_id"."parent_left" < $611))  OR  (("stock_move__location_dest_id"."parent_left" >= $612)  AND  ("stock_move__location_dest_id"."parent_left" < $613)))  OR  ("stock_move"."location_dest_id" in ($614))))  AND  (((("stock_move__location_id"."parent_left" < $615)  OR  ("stock_move__location_id"."parent_left" >= $616))  AND  (("stock_move__location_id"."parent_left" < $617)  OR  ("stock_move__location_id"."parent_left" >= $618)))  AND  (NOT (("stock_move"."location_id" in ($619))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
117 min < 0.1% 2 ms 4,411,277 odoo
SELECT "stock_location".id FROM "stock_location" WHERE ("stock_location"."parent_left" <= $1) ORDER BY "stock_location"."parent_left"
110 min < 0.1% 15,840 ms 416 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $608)  AND  ("stock_move__location_id"."parent_left" < $609))  OR  (("stock_move__location_id"."parent_left" >= $610)  AND  ("stock_move__location_id"."parent_left" < $611)))  OR  (("stock_move__location_id"."parent_left" >= $612)  AND  ("stock_move__location_id"."parent_left" < $613)))  OR  (("stock_move__location_id"."parent_left" >= $614)  AND  ("stock_move__location_id"."parent_left" < $615)))  OR  (("stock_move__location_id"."parent_left" >= $616)  AND  ("stock_move__location_id"."parent_left" < $617)))  OR  (("stock_move__location_id"."parent_left" >= $618)  AND  ("stock_move__location_id"."parent_left" < $619)))  OR  (("stock_move__location_id"."parent_left" >= $620)  AND  ("stock_move__location_id"."parent_left" < $621)))  OR  (("stock_move__location_id"."parent_left" >= $622)  AND  ("stock_move__location_id"."parent_left" < $623)))  OR  (("stock_move__location_id"."parent_left" >= $624)  AND  ("stock_move__location_id"."parent_left" < $625)))  OR  (("stock_move__location_id"."parent_left" >= $626)  AND  ("stock_move__location_id"."parent_left" < $627)))  OR  (("stock_move__location_id"."parent_left" >= $628)  AND  ("stock_move__location_id"."parent_left" < $629)))  OR  (("stock_move__location_id"."parent_left" >= $630)  AND  ("stock_move__location_id"."parent_left" < $631)))  OR  (("stock_move__location_id"."parent_left" >= $632)  AND  ("stock_move__location_id"."parent_left" < $633)))  OR  (("stock_move__location_id"."parent_left" >= $634)  AND  ("stock_move__location_id"."parent_left" < $635))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $636)  OR  ("stock_move__location_dest_id"."parent_left" >= $637))  AND  (("stock_move__location_dest_id"."parent_left" < $638)  OR  ("stock_move__location_dest_id"."parent_left" >= $639)))  AND  (("stock_move__location_dest_id"."parent_left" < $640)  OR  ("stock_move__location_dest_id"."parent_left" >= $641)))  AND  (("stock_move__location_dest_id"."parent_left" < $642)  OR  ("stock_move__location_dest_id"."parent_left" >= $643)))  AND  (("stock_move__location_dest_id"."parent_left" < $644)  OR  ("stock_move__location_dest_id"."parent_left" >= $645)))  AND  (("stock_move__location_dest_id"."parent_left" < $646)  OR  ("stock_move__location_dest_id"."parent_left" >= $647)))  AND  (("stock_move__location_dest_id"."parent_left" < $648)  OR  ("stock_move__location_dest_id"."parent_left" >= $649)))  AND  (("stock_move__location_dest_id"."parent_left" < $650)  OR  ("stock_move__location_dest_id"."parent_left" >= $651)))  AND  (("stock_move__location_dest_id"."parent_left" < $652)  OR  ("stock_move__location_dest_id"."parent_left" >= $653)))  AND  (("stock_move__location_dest_id"."parent_left" < $654)  OR  ("stock_move__location_dest_id"."parent_left" >= $655)))  AND  (("stock_move__location_dest_id"."parent_left" < $656)  OR  ("stock_move__location_dest_id"."parent_left" >= $657)))  AND  (("stock_move__location_dest_id"."parent_left" < $658)  OR  ("stock_move__location_dest_id"."parent_left" >= $659)))  AND  (("stock_move__location_dest_id"."parent_left" < $660)  OR  ("stock_move__location_dest_id"."parent_left" >= $661)))  AND  (("stock_move__location_dest_id"."parent_left" < $662)  OR  ("stock_move__location_dest_id"."parent_left" >= $663))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
107 min < 0.1% 5 ms 1,182,035 odoo
SELECT "product_product".id FROM "product_product" WHERE (("product_product"."active" = $1)  AND  ("product_product"."product_tmpl_id" in ($2))) ORDER BY "product_product"."default_code" ,"product_product"."id"
Covered by index on (product_tmpl_id)
Rows: 1000206
Row progression: 1000206, 620, 310

Row estimates
- product_tmpl_id (=): 620
- active (=): 500103
- default_code (sort): 0
- id (sort): 1

Existing indexes
- id PRIMARY
- active, default_code
- barcode UNIQUE
- default_code
- product_tmpl_id
105 min < 0.1% 11,266 ms 561 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" >= $609)  AND  ("stock_move__location_dest_id"."parent_left" < $610))  OR  (("stock_move__location_dest_id"."parent_left" >= $611)  AND  ("stock_move__location_dest_id"."parent_left" < $612)))  OR  (("stock_move__location_dest_id"."parent_left" >= $613)  AND  ("stock_move__location_dest_id"."parent_left" < $614)))  OR  (("stock_move__location_dest_id"."parent_left" >= $615)  AND  ("stock_move__location_dest_id"."parent_left" < $616)))  OR  (("stock_move__location_dest_id"."parent_left" >= $617)  AND  ("stock_move__location_dest_id"."parent_left" < $618)))  OR  (("stock_move__location_dest_id"."parent_left" >= $619)  AND  ("stock_move__location_dest_id"."parent_left" < $620)))  OR  (("stock_move__location_dest_id"."parent_left" >= $621)  AND  ("stock_move__location_dest_id"."parent_left" < $622)))  OR  (("stock_move__location_dest_id"."parent_left" >= $623)  AND  ("stock_move__location_dest_id"."parent_left" < $624)))  OR  (("stock_move__location_dest_id"."parent_left" >= $625)  AND  ("stock_move__location_dest_id"."parent_left" < $626)))  OR  (("stock_move__location_dest_id"."parent_left" >= $627)  AND  ("stock_move__location_dest_id"."parent_left" < $628)))  OR  (("stock_move__location_dest_id"."parent_left" >= $629)  AND  ("stock_move__location_dest_id"."parent_left" < $630)))  OR  (("stock_move__location_dest_id"."parent_left" >= $631)  AND  ("stock_move__location_dest_id"."parent_left" < $632)))  OR  (("stock_move__location_dest_id"."parent_left" >= $633)  AND  ("stock_move__location_dest_id"."parent_left" < $634)))  OR  (("stock_move__location_dest_id"."parent_left" >= $635)  AND  ("stock_move__location_dest_id"."parent_left" < $636))))  AND  ((((((((((((((("stock_move__location_id"."parent_left" < $637)  OR  ("stock_move__location_id"."parent_left" >= $638))  AND  (("stock_move__location_id"."parent_left" < $639)  OR  ("stock_move__location_id"."parent_left" >= $640)))  AND  (("stock_move__location_id"."parent_left" < $641)  OR  ("stock_move__location_id"."parent_left" >= $642)))  AND  (("stock_move__location_id"."parent_left" < $643)  OR  ("stock_move__location_id"."parent_left" >= $644)))  AND  (("stock_move__location_id"."parent_left" < $645)  OR  ("stock_move__location_id"."parent_left" >= $646)))  AND  (("stock_move__location_id"."parent_left" < $647)  OR  ("stock_move__location_id"."parent_left" >= $648)))  AND  (("stock_move__location_id"."parent_left" < $649)  OR  ("stock_move__location_id"."parent_left" >= $650)))  AND  (("stock_move__location_id"."parent_left" < $651)  OR  ("stock_move__location_id"."parent_left" >= $652)))  AND  (("stock_move__location_id"."parent_left" < $653)  OR  ("stock_move__location_id"."parent_left" >= $654)))  AND  (("stock_move__location_id"."parent_left" < $655)  OR  ("stock_move__location_id"."parent_left" >= $656)))  AND  (("stock_move__location_id"."parent_left" < $657)  OR  ("stock_move__location_id"."parent_left" >= $658)))  AND  (("stock_move__location_id"."parent_left" < $659)  OR  ("stock_move__location_id"."parent_left" >= $660)))  AND  (("stock_move__location_id"."parent_left" < $661)  OR  ("stock_move__location_id"."parent_left" >= $662)))  AND  (("stock_move__location_id"."parent_left" < $663)  OR  ("stock_move__location_id"."parent_left" >= $664))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
103 min < 0.1% 11,249 ms 550 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_dest_id"."parent_left" >= $609)  AND  ("stock_move__location_dest_id"."parent_left" < $610))  OR  (("stock_move__location_dest_id"."parent_left" >= $611)  AND  ("stock_move__location_dest_id"."parent_left" < $612)))  OR  ("stock_move"."location_dest_id" in ($613))))  AND  (((("stock_move__location_id"."parent_left" < $614)  OR  ("stock_move__location_id"."parent_left" >= $615))  AND  (("stock_move__location_id"."parent_left" < $616)  OR  ("stock_move__location_id"."parent_left" >= $617)))  AND  (NOT (("stock_move"."location_id" in ($618))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
98 min < 0.1% 93 ms 63,595 odoo
SELECT "material_requisition_line".id FROM "material_requisition_line" LEFT JOIN "res_partner" as "material_requisition_line__partner_id" ON ("material_requisition_line"."partner_id" = "material_requisition_line__partner_id"."id") LEFT JOIN "product_category" as "material_requisition_line__categ_id" ON ("material_requisition_line"."categ_id" = "material_requisition_line__categ_id"."id") LEFT JOIN "product_product" as "material_requisition_line__product_id" ON ("material_requisition_line"."product_id" = "material_requisition_line__product_id"."id") WHERE ("material_requisition_line"."requisition_id" in ($1)) ORDER BY "material_requisition_line__partner_id"."display_name" ,"material_requisition_line__categ_id"."parent_left" ,"material_requisition_line__product_id"."default_code" ,"material_requisition_line__product_id"."id"
93 min < 0.1% 24,787 ms 225 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $634)  AND  ("stock_move__location_id"."parent_left" < $635))  OR  (("stock_move__location_id"."parent_left" >= $636)  AND  ("stock_move__location_id"."parent_left" < $637)))  OR  (("stock_move__location_id"."parent_left" >= $638)  AND  ("stock_move__location_id"."parent_left" < $639)))  OR  (("stock_move__location_id"."parent_left" >= $640)  AND  ("stock_move__location_id"."parent_left" < $641)))  OR  (("stock_move__location_id"."parent_left" >= $642)  AND  ("stock_move__location_id"."parent_left" < $643)))  OR  (("stock_move__location_id"."parent_left" >= $644)  AND  ("stock_move__location_id"."parent_left" < $645)))  OR  (("stock_move__location_id"."parent_left" >= $646)  AND  ("stock_move__location_id"."parent_left" < $647)))  OR  (("stock_move__location_id"."parent_left" >= $648)  AND  ("stock_move__location_id"."parent_left" < $649)))  OR  (("stock_move__location_id"."parent_left" >= $650)  AND  ("stock_move__location_id"."parent_left" < $651)))  OR  (("stock_move__location_id"."parent_left" >= $652)  AND  ("stock_move__location_id"."parent_left" < $653)))  OR  (("stock_move__location_id"."parent_left" >= $654)  AND  ("stock_move__location_id"."parent_left" < $655)))  OR  (("stock_move__location_id"."parent_left" >= $656)  AND  ("stock_move__location_id"."parent_left" < $657)))  OR  (("stock_move__location_id"."parent_left" >= $658)  AND  ("stock_move__location_id"."parent_left" < $659)))  OR  (("stock_move__location_id"."parent_left" >= $660)  AND  ("stock_move__location_id"."parent_left" < $661))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $662)  OR  ("stock_move__location_dest_id"."parent_left" >= $663))  AND  (("stock_move__location_dest_id"."parent_left" < $664)  OR  ("stock_move__location_dest_id"."parent_left" >= $665)))  AND  (("stock_move__location_dest_id"."parent_left" < $666)  OR  ("stock_move__location_dest_id"."parent_left" >= $667)))  AND  (("stock_move__location_dest_id"."parent_left" < $668)  OR  ("stock_move__location_dest_id"."parent_left" >= $669)))  AND  (("stock_move__location_dest_id"."parent_left" < $670)  OR  ("stock_move__location_dest_id"."parent_left" >= $671)))  AND  (("stock_move__location_dest_id"."parent_left" < $672)  OR  ("stock_move__location_dest_id"."parent_left" >= $673)))  AND  (("stock_move__location_dest_id"."parent_left" < $674)  OR  ("stock_move__location_dest_id"."parent_left" >= $675)))  AND  (("stock_move__location_dest_id"."parent_left" < $676)  OR  ("stock_move__location_dest_id"."parent_left" >= $677)))  AND  (("stock_move__location_dest_id"."parent_left" < $678)  OR  ("stock_move__location_dest_id"."parent_left" >= $679)))  AND  (("stock_move__location_dest_id"."parent_left" < $680)  OR  ("stock_move__location_dest_id"."parent_left" >= $681)))  AND  (("stock_move__location_dest_id"."parent_left" < $682)  OR  ("stock_move__location_dest_id"."parent_left" >= $683)))  AND  (("stock_move__location_dest_id"."parent_left" < $684)  OR  ("stock_move__location_dest_id"."parent_left" >= $685)))  AND  (("stock_move__location_dest_id"."parent_left" < $686)  OR  ("stock_move__location_dest_id"."parent_left" >= $687)))  AND  (("stock_move__location_dest_id"."parent_left" < $688)  OR  ("stock_move__location_dest_id"."parent_left" >= $689))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
91 min < 0.1% 10,132 ms 541 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_id"."parent_left" >= $609)  AND  ("stock_move__location_id"."parent_left" < $610))  OR  (("stock_move__location_id"."parent_left" >= $611)  AND  ("stock_move__location_id"."parent_left" < $612)))  OR  ("stock_move"."location_id" in ($613))))  AND  (((("stock_move__location_dest_id"."parent_left" < $614)  OR  ("stock_move__location_dest_id"."parent_left" >= $615))  AND  (("stock_move__location_dest_id"."parent_left" < $616)  OR  ("stock_move__location_dest_id"."parent_left" >= $617)))  AND  (NOT (("stock_move"."location_dest_id" in ($618))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
89 min < 0.1% 1 ms 5,674,634 odoo
UPDATE "stock_move" SET "is_done"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 19551702
Row progression: 19551702, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- company_id
- create_date
- created_production_id
- date
- date_expected
- location_id
- name
- origin_returned_move_id
- picking_id, id
- product_id, location_id, location_dest_id, company_id, state
- product_id, location_id, location_dest_id, state
- purchase_line_id
- scrapped
- state
88 min < 0.1% 0 ms 26,375,621 odoo
SELECT "stock_quant"."id" as "id","stock_quant"."owner_id" as "owner_id","stock_quant"."package_id" as "package_id","stock_quant"."quantity" as "quantity","stock_quant"."in_date" as "in_date","stock_quant"."removal_date" as "removal_date","stock_quant"."commissary_reserved" as "commissary_reserved","stock_quant"."create_date" as "create_date","stock_quant"."lot_id" as "lot_id","stock_quant"."commissary_quantity" as "commissary_quantity","stock_quant"."write_date" as "write_date","stock_quant"."location_id" as "location_id","stock_quant"."product_id" as "product_id","stock_quant"."create_uid" as "create_uid","stock_quant"."write_uid" as "write_uid","stock_quant"."reserved_quantity" as "reserved_quantity","stock_quant"."company_id" as "company_id" FROM "stock_quant" WHERE "stock_quant".id IN ($1)
Covered by index on (id)
Rows: 2922664
Row progression: 2922664, 1

Row estimates
- id (=): 1

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

Row estimates
- id (=): 1

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

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- name
- state
80 min < 0.1% 10,214 ms 470 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_id"."parent_left" >= $610)  AND  ("stock_move__location_id"."parent_left" < $611))  OR  (("stock_move__location_id"."parent_left" >= $612)  AND  ("stock_move__location_id"."parent_left" < $613)))  OR  ("stock_move"."location_id" in ($614))))  AND  (((("stock_move__location_dest_id"."parent_left" < $615)  OR  ("stock_move__location_dest_id"."parent_left" >= $616))  AND  (("stock_move__location_dest_id"."parent_left" < $617)  OR  ("stock_move__location_dest_id"."parent_left" >= $618)))  AND  (NOT (("stock_move"."location_dest_id" in ($619))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
76 min < 0.1% 23,167 ms 196 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_id"."parent_left" >= $618)  AND  ("stock_move__location_id"."parent_left" < $619))  OR  (("stock_move__location_id"."parent_left" >= $620)  AND  ("stock_move__location_id"."parent_left" < $621)))  OR  (("stock_move__location_id"."parent_left" >= $622)  AND  ("stock_move__location_id"."parent_left" < $623)))  OR  (("stock_move__location_id"."parent_left" >= $624)  AND  ("stock_move__location_id"."parent_left" < $625)))  OR  (("stock_move__location_id"."parent_left" >= $626)  AND  ("stock_move__location_id"."parent_left" < $627)))  OR  (("stock_move__location_id"."parent_left" >= $628)  AND  ("stock_move__location_id"."parent_left" < $629)))  OR  (("stock_move__location_id"."parent_left" >= $630)  AND  ("stock_move__location_id"."parent_left" < $631)))  OR  (("stock_move__location_id"."parent_left" >= $632)  AND  ("stock_move__location_id"."parent_left" < $633)))  OR  (("stock_move__location_id"."parent_left" >= $634)  AND  ("stock_move__location_id"."parent_left" < $635)))  OR  (("stock_move__location_id"."parent_left" >= $636)  AND  ("stock_move__location_id"."parent_left" < $637)))  OR  (("stock_move__location_id"."parent_left" >= $638)  AND  ("stock_move__location_id"."parent_left" < $639)))  OR  (("stock_move__location_id"."parent_left" >= $640)  AND  ("stock_move__location_id"."parent_left" < $641)))  OR  (("stock_move__location_id"."parent_left" >= $642)  AND  ("stock_move__location_id"."parent_left" < $643)))  OR  (("stock_move__location_id"."parent_left" >= $644)  AND  ("stock_move__location_id"."parent_left" < $645))))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" < $646)  OR  ("stock_move__location_dest_id"."parent_left" >= $647))  AND  (("stock_move__location_dest_id"."parent_left" < $648)  OR  ("stock_move__location_dest_id"."parent_left" >= $649)))  AND  (("stock_move__location_dest_id"."parent_left" < $650)  OR  ("stock_move__location_dest_id"."parent_left" >= $651)))  AND  (("stock_move__location_dest_id"."parent_left" < $652)  OR  ("stock_move__location_dest_id"."parent_left" >= $653)))  AND  (("stock_move__location_dest_id"."parent_left" < $654)  OR  ("stock_move__location_dest_id"."parent_left" >= $655)))  AND  (("stock_move__location_dest_id"."parent_left" < $656)  OR  ("stock_move__location_dest_id"."parent_left" >= $657)))  AND  (("stock_move__location_dest_id"."parent_left" < $658)  OR  ("stock_move__location_dest_id"."parent_left" >= $659)))  AND  (("stock_move__location_dest_id"."parent_left" < $660)  OR  ("stock_move__location_dest_id"."parent_left" >= $661)))  AND  (("stock_move__location_dest_id"."parent_left" < $662)  OR  ("stock_move__location_dest_id"."parent_left" >= $663)))  AND  (("stock_move__location_dest_id"."parent_left" < $664)  OR  ("stock_move__location_dest_id"."parent_left" >= $665)))  AND  (("stock_move__location_dest_id"."parent_left" < $666)  OR  ("stock_move__location_dest_id"."parent_left" >= $667)))  AND  (("stock_move__location_dest_id"."parent_left" < $668)  OR  ("stock_move__location_dest_id"."parent_left" >= $669)))  AND  (("stock_move__location_dest_id"."parent_left" < $670)  OR  ("stock_move__location_dest_id"."parent_left" >= $671)))  AND  (("stock_move__location_dest_id"."parent_left" < $672)  OR  ("stock_move__location_dest_id"."parent_left" >= $673))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
73 min < 0.1% 0 ms 22,243,415 odoo
SELECT "stock_quant"."id" as "id","stock_quant"."company_id" as "company_id","stock_quant"."owner_id" as "owner_id","stock_quant"."removal_date" as "removal_date","stock_quant"."create_uid" as "create_uid","stock_quant"."commissary_quantity" as "commissary_quantity","stock_quant"."create_date" as "create_date","stock_quant"."write_uid" as "write_uid","stock_quant"."package_id" as "package_id","stock_quant"."in_date" as "in_date","stock_quant"."reserved_quantity" as "reserved_quantity","stock_quant"."lot_id" as "lot_id","stock_quant"."write_date" as "write_date","stock_quant"."location_id" as "location_id","stock_quant"."product_id" as "product_id","stock_quant"."commissary_reserved" as "commissary_reserved","stock_quant"."quantity" as "quantity" FROM "stock_quant" WHERE "stock_quant".id IN ($1)
Covered by index on (id)
Rows: 2922664
Row progression: 2922664, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- lot_id
- product_id
72 min < 0.1% 10,177 ms 427 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" >= $605)  AND  ("stock_move__location_dest_id"."parent_left" < $606))  OR  (("stock_move__location_dest_id"."parent_left" >= $607)  AND  ("stock_move__location_dest_id"."parent_left" < $608)))  OR  (("stock_move__location_dest_id"."parent_left" >= $609)  AND  ("stock_move__location_dest_id"."parent_left" < $610)))  OR  (("stock_move__location_dest_id"."parent_left" >= $611)  AND  ("stock_move__location_dest_id"."parent_left" < $612)))  OR  (("stock_move__location_dest_id"."parent_left" >= $613)  AND  ("stock_move__location_dest_id"."parent_left" < $614)))  OR  (("stock_move__location_dest_id"."parent_left" >= $615)  AND  ("stock_move__location_dest_id"."parent_left" < $616)))  OR  (("stock_move__location_dest_id"."parent_left" >= $617)  AND  ("stock_move__location_dest_id"."parent_left" < $618)))  OR  (("stock_move__location_dest_id"."parent_left" >= $619)  AND  ("stock_move__location_dest_id"."parent_left" < $620)))  OR  (("stock_move__location_dest_id"."parent_left" >= $621)  AND  ("stock_move__location_dest_id"."parent_left" < $622)))  OR  (("stock_move__location_dest_id"."parent_left" >= $623)  AND  ("stock_move__location_dest_id"."parent_left" < $624)))  OR  (("stock_move__location_dest_id"."parent_left" >= $625)  AND  ("stock_move__location_dest_id"."parent_left" < $626)))  OR  (("stock_move__location_dest_id"."parent_left" >= $627)  AND  ("stock_move__location_dest_id"."parent_left" < $628)))  OR  (("stock_move__location_dest_id"."parent_left" >= $629)  AND  ("stock_move__location_dest_id"."parent_left" < $630)))  OR  (("stock_move__location_dest_id"."parent_left" >= $631)  AND  ("stock_move__location_dest_id"."parent_left" < $632))))  AND  ((((((((((((((("stock_move__location_id"."parent_left" < $633)  OR  ("stock_move__location_id"."parent_left" >= $634))  AND  (("stock_move__location_id"."parent_left" < $635)  OR  ("stock_move__location_id"."parent_left" >= $636)))  AND  (("stock_move__location_id"."parent_left" < $637)  OR  ("stock_move__location_id"."parent_left" >= $638)))  AND  (("stock_move__location_id"."parent_left" < $639)  OR  ("stock_move__location_id"."parent_left" >= $640)))  AND  (("stock_move__location_id"."parent_left" < $641)  OR  ("stock_move__location_id"."parent_left" >= $642)))  AND  (("stock_move__location_id"."parent_left" < $643)  OR  ("stock_move__location_id"."parent_left" >= $644)))  AND  (("stock_move__location_id"."parent_left" < $645)  OR  ("stock_move__location_id"."parent_left" >= $646)))  AND  (("stock_move__location_id"."parent_left" < $647)  OR  ("stock_move__location_id"."parent_left" >= $648)))  AND  (("stock_move__location_id"."parent_left" < $649)  OR  ("stock_move__location_id"."parent_left" >= $650)))  AND  (("stock_move__location_id"."parent_left" < $651)  OR  ("stock_move__location_id"."parent_left" >= $652)))  AND  (("stock_move__location_id"."parent_left" < $653)  OR  ("stock_move__location_id"."parent_left" >= $654)))  AND  (("stock_move__location_id"."parent_left" < $655)  OR  ("stock_move__location_id"."parent_left" >= $656)))  AND  (("stock_move__location_id"."parent_left" < $657)  OR  ("stock_move__location_id"."parent_left" >= $658)))  AND  (("stock_move__location_id"."parent_left" < $659)  OR  ("stock_move__location_id"."parent_left" >= $660))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
71 min < 0.1% 0 ms 37,772,063 odoo
DISCARD ALL
70 min < 0.1% 10,510 ms 402 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_id"."parent_left" >= $605)  AND  ("stock_move__location_id"."parent_left" < $606))  OR  (("stock_move__location_id"."parent_left" >= $607)  AND  ("stock_move__location_id"."parent_left" < $608)))  OR  ("stock_move"."location_id" in ($609))))  AND  (((("stock_move__location_dest_id"."parent_left" < $610)  OR  ("stock_move__location_dest_id"."parent_left" >= $611))  AND  (("stock_move__location_dest_id"."parent_left" < $612)  OR  ("stock_move__location_dest_id"."parent_left" >= $613)))  AND  (NOT (("stock_move"."location_dest_id" in ($614))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
70 min < 0.1% 17,837 ms 234 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_dest_id"."parent_left" >= $622)  AND  ("stock_move__location_dest_id"."parent_left" < $623))  OR  (("stock_move__location_dest_id"."parent_left" >= $624)  AND  ("stock_move__location_dest_id"."parent_left" < $625)))  OR  ("stock_move"."location_dest_id" in ($626))))  AND  (((("stock_move__location_id"."parent_left" < $627)  OR  ("stock_move__location_id"."parent_left" >= $628))  AND  (("stock_move__location_id"."parent_left" < $629)  OR  ("stock_move__location_id"."parent_left" >= $630)))  AND  (NOT (("stock_move"."location_id" in ($631))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
69 min < 0.1% 21,908 ms 188 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" >= $921)  AND  ("stock_move__location_dest_id"."parent_left" < $922))  OR  (("stock_move__location_dest_id"."parent_left" >= $923)  AND  ("stock_move__location_dest_id"."parent_left" < $924)))  OR  (("stock_move__location_dest_id"."parent_left" >= $925)  AND  ("stock_move__location_dest_id"."parent_left" < $926)))  OR  (("stock_move__location_dest_id"."parent_left" >= $927)  AND  ("stock_move__location_dest_id"."parent_left" < $928)))  OR  (("stock_move__location_dest_id"."parent_left" >= $929)  AND  ("stock_move__location_dest_id"."parent_left" < $930)))  OR  (("stock_move__location_dest_id"."parent_left" >= $931)  AND  ("stock_move__location_dest_id"."parent_left" < $932)))  OR  (("stock_move__location_dest_id"."parent_left" >= $933)  AND  ("stock_move__location_dest_id"."parent_left" < $934)))  OR  (("stock_move__location_dest_id"."parent_left" >= $935)  AND  ("stock_move__location_dest_id"."parent_left" < $936)))  OR  (("stock_move__location_dest_id"."parent_left" >= $937)  AND  ("stock_move__location_dest_id"."parent_left" < $938)))  OR  (("stock_move__location_dest_id"."parent_left" >= $939)  AND  ("stock_move__location_dest_id"."parent_left" < $940)))  OR  (("stock_move__location_dest_id"."parent_left" >= $941)  AND  ("stock_move__location_dest_id"."parent_left" < $942)))  OR  (("stock_move__location_dest_id"."parent_left" >= $943)  AND  ("stock_move__location_dest_id"."parent_left" < $944)))  OR  (("stock_move__location_dest_id"."parent_left" >= $945)  AND  ("stock_move__location_dest_id"."parent_left" < $946)))  OR  (("stock_move__location_dest_id"."parent_left" >= $947)  AND  ("stock_move__location_dest_id"."parent_left" < $948))))  AND  ((((((((((((((("stock_move__location_id"."parent_left" < $949)  OR  ("stock_move__location_id"."parent_left" >= $950))  AND  (("stock_move__location_id"."parent_left" < $951)  OR  ("stock_move__location_id"."parent_left" >= $952)))  AND  (("stock_move__location_id"."parent_left" < $953)  OR  ("stock_move__location_id"."parent_left" >= $954)))  AND  (("stock_move__location_id"."parent_left" < $955)  OR  ("stock_move__location_id"."parent_left" >= $956)))  AND  (("stock_move__location_id"."parent_left" < $957)  OR  ("stock_move__location_id"."parent_left" >= $958)))  AND  (("stock_move__location_id"."parent_left" < $959)  OR  ("stock_move__location_id"."parent_left" >= $960)))  AND  (("stock_move__location_id"."parent_left" < $961)  OR  ("stock_move__location_id"."parent_left" >= $962)))  AND  (("stock_move__location_id"."parent_left" < $963)  OR  ("stock_move__location_id"."parent_left" >= $964)))  AND  (("stock_move__location_id"."parent_left" < $965)  OR  ("stock_move__location_id"."parent_left" >= $966)))  AND  (("stock_move__location_id"."parent_left" < $967)  OR  ("stock_move__location_id"."parent_left" >= $968)))  AND  (("stock_move__location_id"."parent_left" < $969)  OR  ("stock_move__location_id"."parent_left" >= $970)))  AND  (("stock_move__location_id"."parent_left" < $971)  OR  ("stock_move__location_id"."parent_left" >= $972)))  AND  (("stock_move__location_id"."parent_left" < $973)  OR  ("stock_move__location_id"."parent_left" >= $974)))  AND  (("stock_move__location_id"."parent_left" < $975)  OR  ("stock_move__location_id"."parent_left" >= $976))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
68 min < 0.1% 153 ms 26,578 odoo
SELECT "stock_inventory_line".id FROM "stock_inventory_line" WHERE ("stock_inventory_line"."prod_lot_id" in ($1)) ORDER BY "stock_inventory_line"."id"
Details
CREATE INDEX CONCURRENTLY ON stock_inventory_line (prod_lot_id)
Rows: 128482
Row progression: 128482, 2

Row estimates
- prod_lot_id (=): 2
- id (sort): 1

Existing indexes
- id PRIMARY
- company_id
- inventory_id
- location_id
- package_id
- product_id
67 min < 0.1% 1 ms 4,411,253 odoo
SELECT "stock_location".id FROM "stock_location" WHERE ("stock_location"."parent_right" >= $1) ORDER BY "stock_location"."parent_left"
67 min < 0.1% 13,233 ms 303 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_dest_id"."parent_left" >= $606)  AND  ("stock_move__location_dest_id"."parent_left" < $607))  OR  (("stock_move__location_dest_id"."parent_left" >= $608)  AND  ("stock_move__location_dest_id"."parent_left" < $609)))  OR  ("stock_move"."location_dest_id" in ($610))))  AND  (((("stock_move__location_id"."parent_left" < $611)  OR  ("stock_move__location_id"."parent_left" >= $612))  AND  (("stock_move__location_id"."parent_left" < $613)  OR  ("stock_move__location_id"."parent_left" >= $614)))  AND  (NOT (("stock_move"."location_id" in ($615))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
67 min < 0.1% 23,216 ms 172 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_id"."parent_left" >= $921)  AND  ("stock_move__location_id"."parent_left" < $922))  OR  (("stock_move__location_id"."parent_left" >= $923)  AND  ("stock_move__location_id"."parent_left" < $924)))  OR  ("stock_move"."location_id" in ($925))))  AND  (((("stock_move__location_dest_id"."parent_left" < $926)  OR  ("stock_move__location_dest_id"."parent_left" >= $927))  AND  (("stock_move__location_dest_id"."parent_left" < $928)  OR  ("stock_move__location_dest_id"."parent_left" >= $929)))  AND  (NOT (("stock_move"."location_dest_id" in ($930))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
65 min < 0.1% 10 ms 380,418 odoo
INSERT INTO "mail_message" ("id", "author_id", "subtype_id", "date", "message_type", "model", "no_auto_thread", "parent_id", "subject", "body", "email_from", "record_name", "message_id", "res_id", "reply_to", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval($1), $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, (now() at time zone $18), (now() at time zone $19)) RETURNING id
64 min < 0.1% 0 ms 69,417,611 odoo
SELECT "product_category".id FROM "product_category" WHERE (("product_category"."id" = $1)  AND  (("product_category"."parent_left" < $2)  AND  ("product_category"."parent_left" >= $3))) ORDER BY "product_category"."parent_left"
64 min < 0.1% 0 ms 26,375,390 odoo
SELECT "stock_move_line".id FROM "stock_move_line" WHERE ("stock_move_line"."move_id" in ($1)) ORDER BY "stock_move_line"."id"
Covered by index on (move_id)
Rows: 16442403
Row progression: 16442403, 1

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

Existing indexes
- id PRIMARY
- move_id
- picking_id
63 min < 0.1% 9,585 ms 394 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_dest_id"."parent_left" >= $608)  AND  ("stock_move__location_dest_id"."parent_left" < $609))  OR  (("stock_move__location_dest_id"."parent_left" >= $610)  AND  ("stock_move__location_dest_id"."parent_left" < $611)))  OR  ("stock_move"."location_dest_id" in ($612))))  AND  (((("stock_move__location_id"."parent_left" < $613)  OR  ("stock_move__location_id"."parent_left" >= $614))  AND  (("stock_move__location_id"."parent_left" < $615)  OR  ("stock_move__location_id"."parent_left" >= $616)))  AND  (NOT (("stock_move"."location_id" in ($617))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
63 min < 0.1% 91 ms 41,280 odoo
SELECT "product_product".id FROM "product_product" WHERE ("product_product"."active" = $1) ORDER BY "product_product"."default_code" ,"product_product"."id"   limit $2
Covered by index on (active, default_code)
Rows: 1000206
Row progression: 1000206, 500103, 0

Row estimates
- active (=): 500103
- default_code (sort): 0
- id (sort): 1

Existing indexes
- id PRIMARY
- active, default_code
- barcode UNIQUE
- default_code
- product_tmpl_id
60 min < 0.1% 8,631 ms 417 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" >= $608)  AND  ("stock_move__location_dest_id"."parent_left" < $609))  OR  (("stock_move__location_dest_id"."parent_left" >= $610)  AND  ("stock_move__location_dest_id"."parent_left" < $611)))  OR  (("stock_move__location_dest_id"."parent_left" >= $612)  AND  ("stock_move__location_dest_id"."parent_left" < $613)))  OR  (("stock_move__location_dest_id"."parent_left" >= $614)  AND  ("stock_move__location_dest_id"."parent_left" < $615)))  OR  (("stock_move__location_dest_id"."parent_left" >= $616)  AND  ("stock_move__location_dest_id"."parent_left" < $617)))  OR  (("stock_move__location_dest_id"."parent_left" >= $618)  AND  ("stock_move__location_dest_id"."parent_left" < $619)))  OR  (("stock_move__location_dest_id"."parent_left" >= $620)  AND  ("stock_move__location_dest_id"."parent_left" < $621)))  OR  (("stock_move__location_dest_id"."parent_left" >= $622)  AND  ("stock_move__location_dest_id"."parent_left" < $623)))  OR  (("stock_move__location_dest_id"."parent_left" >= $624)  AND  ("stock_move__location_dest_id"."parent_left" < $625)))  OR  (("stock_move__location_dest_id"."parent_left" >= $626)  AND  ("stock_move__location_dest_id"."parent_left" < $627)))  OR  (("stock_move__location_dest_id"."parent_left" >= $628)  AND  ("stock_move__location_dest_id"."parent_left" < $629)))  OR  (("stock_move__location_dest_id"."parent_left" >= $630)  AND  ("stock_move__location_dest_id"."parent_left" < $631)))  OR  (("stock_move__location_dest_id"."parent_left" >= $632)  AND  ("stock_move__location_dest_id"."parent_left" < $633)))  OR  (("stock_move__location_dest_id"."parent_left" >= $634)  AND  ("stock_move__location_dest_id"."parent_left" < $635))))  AND  ((((((((((((((("stock_move__location_id"."parent_left" < $636)  OR  ("stock_move__location_id"."parent_left" >= $637))  AND  (("stock_move__location_id"."parent_left" < $638)  OR  ("stock_move__location_id"."parent_left" >= $639)))  AND  (("stock_move__location_id"."parent_left" < $640)  OR  ("stock_move__location_id"."parent_left" >= $641)))  AND  (("stock_move__location_id"."parent_left" < $642)  OR  ("stock_move__location_id"."parent_left" >= $643)))  AND  (("stock_move__location_id"."parent_left" < $644)  OR  ("stock_move__location_id"."parent_left" >= $645)))  AND  (("stock_move__location_id"."parent_left" < $646)  OR  ("stock_move__location_id"."parent_left" >= $647)))  AND  (("stock_move__location_id"."parent_left" < $648)  OR  ("stock_move__location_id"."parent_left" >= $649)))  AND  (("stock_move__location_id"."parent_left" < $650)  OR  ("stock_move__location_id"."parent_left" >= $651)))  AND  (("stock_move__location_id"."parent_left" < $652)  OR  ("stock_move__location_id"."parent_left" >= $653)))  AND  (("stock_move__location_id"."parent_left" < $654)  OR  ("stock_move__location_id"."parent_left" >= $655)))  AND  (("stock_move__location_id"."parent_left" < $656)  OR  ("stock_move__location_id"."parent_left" >= $657)))  AND  (("stock_move__location_id"."parent_left" < $658)  OR  ("stock_move__location_id"."parent_left" >= $659)))  AND  (("stock_move__location_id"."parent_left" < $660)  OR  ("stock_move__location_id"."parent_left" >= $661)))  AND  (("stock_move__location_id"."parent_left" < $662)  OR  ("stock_move__location_id"."parent_left" >= $663))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
60 min < 0.1% 87,445 ms 41 odoo
SELECT "mail_message".id FROM "mail_message" WHERE (("mail_message"."model" = 'queue.job')  AND  ("mail_message"."res_id" in (137865548,137865546,137865545,137865479,137865474,137865472,137865471,137865466,137865465,137865392,137865393,137865391,137865390,137865389,137865388,137865387,137865386,137865380,137865379,137865376,137865374,137865375,137865373,137865372,137865365,137865364,137865363,137865354,137865353,137865351,137865350,137865349,137865346,137865345,137865337,137865335,137865334,137865332,137865333,137865328,137865325,137865315,137865314,137865075,137865070,137865068,137865067,137865063,137865062,137865044,137865040,137865039,137865029,137865026,137865024,137865023,137864984,137864983,137864982,137864981,137864980,137864977,137864976,137864975,137864970,137864969,137864968,137864966,137864967,137864965,137864964,137864963,137864962,137864955,137864954,137864949,137864948,137864945,137864944,137864943,137864942,137864941,137864940,137864939,137864937,137864935,137864932,137864931,137864930,137864929,137864927,137864926,137864916,137864915,137864896,137864895,137864894,137864893,137864888,137864886,137864870,137864867,137864863,137864862,137864859,137864858,137864852,137864786,137864784,137864783,137864745,137864746,137864744,137864743,137864737,137864736,137864705,137864704,137864703,137864702,137864701,137864700,137864699,137864698,137864690,137864689,137864685,137864683,137864684,137864682,137864681,137864678,137864677,137864676,137864668,137864667,137864663,137864662,137864661,137864658,137864657,137864648,137864646,137864645,137864636,137864635,137864578,137864572,137864569,137864568,137864564,137864559,137864553,137864459,137864460,137864458,137864457,137864455,137864454,137864452,137864453,137864451,137864446,137864445,137864442,137864441,137864440,137864438,137864437,137864436,137864435,137864433,137864431,137864434,137864432,137864429,137864430,137864425,137864424,137864423,137864421,137864422,137864419,137864418,137864420,137864414,137864413,137864412,137864411,137864410,137864409,137864408,137864407,137864404,137864403,137864386,137864380,137864379,137864375,137864309,137864304,137864302,137864301,137864298,137864297,137864272,137864271,137864270,137864269,137864266,137864265,137864222,137864220,137864219,137864216,137864215,137864214,137864213,137864212,137864210,137864209,137864208,137864204,137864203,137864159,137864158,137864157,137864156,137864155,137864151,137864150,137864149,137864146,137864145,137864144,137864137,137864134,137864132,137864131,137864128,137864127,137864126,137864125,137864120,137864119,137864118,137864117,137864116,137864115,137864114,137864113,137864108,137864107,137864106,137864105,137864104,137864102,137864101,137864091,137864090,137864045,137864044,137864039,137864036,137864032,137864030,137864029,137864026,137864025,137864022,137864021,137864019,137864018,137864016,137864015,137863983,137863982,137863981,137863980,137863979,137863974,137863971,137863970,137863969,137863955,137863950,137863945,137863940,137863939,137863938,137863937,137863935,137863936,137863933,137863934,137863931,137863930,137863926,137863925,137863922,137863918,137863917,137863914,137863913,137863912,137863910,137863908,137863907,137863906,137863905,137863904,137863903,137863898,137863897,137863896,137863884,137863883,137863880,137863879,137863878,137863877,137863876,137863863,137863862,137863859,137863857,137863856,137863855,137863854,137863847,137863844,137863843,137863842,137863837,137863838,137863839,137863835,137863836,137863832,137863827,137863826,137863825,137863824,137863823,137863821,137863820,137863817,137863815,137863814,137863810,137863806,137863805,137863800,137863801,137863798,137863799,137863794,137863795,137863793,137863791,137863790,137863787,137863786,137863781,137863780,137863779,137863777,137863776,137863771,137863772,137863770,137863769,137863768,137863767,137863762,137863758,137863757,137863756,137863755,137863754,137863753,137863749,137863748,137863750,137863747,137863745,137863744,137863739,137863738,137863716,137863715,137863714,137863713,137863712,137863706,137863701,137863697,137863695,137863694,137863693,137863692,137863691,137863690,137863689,137863688,137863686,137863685,137863683,137863682,137863678,137863677,137863672,137863671,137863669,137863667,137863668,137863666,137863664,137863665,137863661,137863660,137863654,137863653,137863652,137863651,137863650,137863647,137863646,137863645,137863642,137863639,137863638,137863635,137863633,137863632,137863619,137863620,137863616,137863615,137863614,137863613,137863612,137863611,137863607,137863604,137863603,137863602,137863601,137863598,137863594,137863593,137863592,137863591,137863590,137863589,137863588,137863581,137863580,137863579,137863576,137863570,137863569,137863568,137863567,137863566,137863565,137863564,137863563,137863562,137863560,137863559,137863558,137863557,137863555,137863554,137863556,137863553,137863552,137863551,137863550,137863546,137863545,137863544,137863541,137863538,137863536,137863535,137863532,137863531,137863530,137863527,137863529,137863528,137863526,137863525,137863523,137863522,137863521,137863520,137863519,137863518,137863517,137863514,137863515,137863511,137863510,137863509,137863506,137863505,137863493,137863491,137863490,137863478,137863477,137863473,137863472,137863471,137863470,137863469,137863462,137863459,137863458,137863457,137863456,137863453,137863450,137863445,137863444,137863443,137863440,137863442,137863438,137863437,137863435,137863433,137863434,137863424,137863423,137863421,137863420,137863418,137863417,137863416,137863411,137863409,137863408,137863405,137863404,137863403,137863402,137863401,137863395,137863394,137863393,137863379,137863380,137863370,137863369,137863368,137863367,137863366,137863355,137863354,137863353,137863352,137863351,137863350,137863343,137863342,137863341,137863340,137863336,137863337,137863334,137863335,137863333,137863332,137863329,137863328,137863326,137863325,137863327,137863324,137863323,137863321,137863322,137863320,137863319,137863318,137863317,137863315,137863316,137863314,137863313,137863311,137863312,137863310,137863309,137863308,137863307,137863306,137863305,137863304,137863303,137863302,137863301,137863300,137863299,137863298,137863297,137863296,137863295,137863294,137863293,137863292,137863291,137863289,137863290,137863288,137863287,137863286,137863285,137863284,137863283,137863281,137863282,137863280,137863279,137863278,137863277,137863276,137863275,137863273,137863274,137863271,137863272,137863270,137863269,137863268,137863267,137863265,137863266,137863263,137863264,137863262,137863261,137863260,137863259,137863258,137863257,137863255,137863256,137863254,137863253,137863251,137863252,137863250,137863249,137863248,137863247,137863245,137863246,137863243,137863244,137863242,137863241,137863239,137863240,137863238,137863237,137863236,137863235,137863233,137863234,137863231,137863232,137863229,137863230,137863227,137863228,137863226,137863225,137863224,137863223,137863222,137863221,137863219,137863220,137863218,137863217,137863216,137863215,137863214,137863213,137863212,137863211,137863209,137863210,137863208,137863207,137863204,137863206,137863205,137863201,137863203,137863202,137863200,137863199,137863198,137863197,137863196,137863195,137863194,137863193,137863192,137863191,137863190,137863189,137863188,137863187,137863186,137863185,137863184,137863183,137863180,137863177,137863174,137863140,137863139,137863138,137863137,137863133,137863132,137863103,137863097,137863096,137863093,137863089,137863087,137863086,137863080,137863079,137863077,137863076,137863052,137863051,137863050,137863049,137863047,137863048,137863043,137863045,137863046,137863044,137863040,137863041,137863009,137863008,137863005,137863002,137862996,137862993,137862991,137862990,137862988,137862987,137862983,137862984,137862980,137862977,137862974,137862973,137862969,137862967,137862966,137862964,137862963,137862956,137862958,137862959,137862957,137862954,137862953,137862935,137862934,137862933,137862932,137862931,137862927,137862925,137862924,137862917,137862916,137862914,137862913,137862912,137862911,137862910,137862893,137862895,137862888,137862889,137862887,137862885,137862884,137862881,137862880,137862879,137862872,137862871,137862870,137862866,137862865,137862864,137862863,137862862,137862861,137862850,137862849,137862848,137862845,137862841,137862837,137862834,137862832,137862831,137862830,137862825,137862829,137862828,137862826,137862827,137862823,137862822,137862824,137862820,137862821,137862819,137862818,137862807,137862809,137862808,137862804,137862803,137862795,137862793,137862792,137862786,137862785,137862783,137862781,137862782,137862780,137862779,137862766,137862765,137862763,137862764,137862762,137862761,137862760,137862749,137862746,137862745,137862742,137862741,137862739,137862740,137862737,137862736,137862735,137862734,137862732,137862731,137862730,137862729,137862728,137862725,137862724,137862723,137862722,137862721,137862720,137862715,137862714,137862712,137862711,137862713,137862710,137862706,137862705,137862702,137862703,137862698,137862699,137862697,137862696,137862695,137862692,137862690,137862689,137862688,137862686,137862687,137862682,137862681,137862680,137862678,137862677,137862671,137862670,137862644,137862642,137862643,137862641,137862640,137862639,137862636,137862635,137862625,137862623,137862624,137862621,137862622,137862620,137862617,137862616,137862615,137862611,137862613,137862614,137862612,137862610,137862606,137862605,137862602,137862603,137862601,137862599,137862598,137862597,137862596,137862595,137862592,137862591,137862589,137862586,137862580,137862579,137862574,137862572,137862571,137862566,137862563,137862562,137862557,137862555,137862554,137862552,137862551,137862548,137862547,137862544,137862541,137862533,137862511,137862510,137862509,137862507,137862506,137862508,137862503,137862502,137862465,137862463,137862461,137862460,137862458,137862457,137862438,137862437,137862436,137862434,137862435,137862433,137862432,137862431,1378
60 min < 0.1% 7 ms 527,414 odoo
SELECT min("stock_quant".id) AS id, count("stock_quant".id) AS "product_id_count" , sum("stock_quant"."quantity") AS "quantity" ,"stock_quant"."product_id" as "product_id" 
            FROM "stock_location" as "stock_quant__location_id","stock_quant"
            WHERE ("stock_quant"."location_id"="stock_quant__location_id"."id") AND (("stock_quant"."product_id" in ($1))  AND  (("stock_quant__location_id"."parent_left" >= $2)  AND  ("stock_quant__location_id"."parent_left" < $3))) AND ("stock_quant"."company_id" IS NULL   OR  ("stock_quant"."company_id" in ($4)))
            GROUP BY "stock_quant"."product_id"
            ORDER BY "id"
57 min < 0.1% 7 ms 514,589 odoo
SELECT "product_delivery_rule".id FROM "product_delivery_rule" WHERE ((("product_delivery_rule"."kitchen_id" = $1)  AND  ("product_delivery_rule"."product_id" = $2))  AND  ("product_delivery_rule"."pause" IS NULL or "product_delivery_rule"."pause" = $3 )) AND $4 ORDER BY "product_delivery_rule"."id"
56 min < 0.1% 10,207 ms 332 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" >= $606)  AND  ("stock_move__location_dest_id"."parent_left" < $607))  OR  (("stock_move__location_dest_id"."parent_left" >= $608)  AND  ("stock_move__location_dest_id"."parent_left" < $609)))  OR  (("stock_move__location_dest_id"."parent_left" >= $610)  AND  ("stock_move__location_dest_id"."parent_left" < $611)))  OR  (("stock_move__location_dest_id"."parent_left" >= $612)  AND  ("stock_move__location_dest_id"."parent_left" < $613)))  OR  (("stock_move__location_dest_id"."parent_left" >= $614)  AND  ("stock_move__location_dest_id"."parent_left" < $615)))  OR  (("stock_move__location_dest_id"."parent_left" >= $616)  AND  ("stock_move__location_dest_id"."parent_left" < $617)))  OR  (("stock_move__location_dest_id"."parent_left" >= $618)  AND  ("stock_move__location_dest_id"."parent_left" < $619)))  OR  (("stock_move__location_dest_id"."parent_left" >= $620)  AND  ("stock_move__location_dest_id"."parent_left" < $621)))  OR  (("stock_move__location_dest_id"."parent_left" >= $622)  AND  ("stock_move__location_dest_id"."parent_left" < $623)))  OR  (("stock_move__location_dest_id"."parent_left" >= $624)  AND  ("stock_move__location_dest_id"."parent_left" < $625)))  OR  (("stock_move__location_dest_id"."parent_left" >= $626)  AND  ("stock_move__location_dest_id"."parent_left" < $627)))  OR  (("stock_move__location_dest_id"."parent_left" >= $628)  AND  ("stock_move__location_dest_id"."parent_left" < $629)))  OR  (("stock_move__location_dest_id"."parent_left" >= $630)  AND  ("stock_move__location_dest_id"."parent_left" < $631)))  OR  (("stock_move__location_dest_id"."parent_left" >= $632)  AND  ("stock_move__location_dest_id"."parent_left" < $633))))  AND  ((((((((((((((("stock_move__location_id"."parent_left" < $634)  OR  ("stock_move__location_id"."parent_left" >= $635))  AND  (("stock_move__location_id"."parent_left" < $636)  OR  ("stock_move__location_id"."parent_left" >= $637)))  AND  (("stock_move__location_id"."parent_left" < $638)  OR  ("stock_move__location_id"."parent_left" >= $639)))  AND  (("stock_move__location_id"."parent_left" < $640)  OR  ("stock_move__location_id"."parent_left" >= $641)))  AND  (("stock_move__location_id"."parent_left" < $642)  OR  ("stock_move__location_id"."parent_left" >= $643)))  AND  (("stock_move__location_id"."parent_left" < $644)  OR  ("stock_move__location_id"."parent_left" >= $645)))  AND  (("stock_move__location_id"."parent_left" < $646)  OR  ("stock_move__location_id"."parent_left" >= $647)))  AND  (("stock_move__location_id"."parent_left" < $648)  OR  ("stock_move__location_id"."parent_left" >= $649)))  AND  (("stock_move__location_id"."parent_left" < $650)  OR  ("stock_move__location_id"."parent_left" >= $651)))  AND  (("stock_move__location_id"."parent_left" < $652)  OR  ("stock_move__location_id"."parent_left" >= $653)))  AND  (("stock_move__location_id"."parent_left" < $654)  OR  ("stock_move__location_id"."parent_left" >= $655)))  AND  (("stock_move__location_id"."parent_left" < $656)  OR  ("stock_move__location_id"."parent_left" >= $657)))  AND  (("stock_move__location_id"."parent_left" < $658)  OR  ("stock_move__location_id"."parent_left" >= $659)))  AND  (("stock_move__location_id"."parent_left" < $660)  OR  ("stock_move__location_id"."parent_left" >= $661))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
55 min < 0.1% 11,781 ms 280 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  ((((((((((((((("stock_move__location_dest_id"."parent_left" >= $626)  AND  ("stock_move__location_dest_id"."parent_left" < $627))  OR  (("stock_move__location_dest_id"."parent_left" >= $628)  AND  ("stock_move__location_dest_id"."parent_left" < $629)))  OR  (("stock_move__location_dest_id"."parent_left" >= $630)  AND  ("stock_move__location_dest_id"."parent_left" < $631)))  OR  (("stock_move__location_dest_id"."parent_left" >= $632)  AND  ("stock_move__location_dest_id"."parent_left" < $633)))  OR  (("stock_move__location_dest_id"."parent_left" >= $634)  AND  ("stock_move__location_dest_id"."parent_left" < $635)))  OR  (("stock_move__location_dest_id"."parent_left" >= $636)  AND  ("stock_move__location_dest_id"."parent_left" < $637)))  OR  (("stock_move__location_dest_id"."parent_left" >= $638)  AND  ("stock_move__location_dest_id"."parent_left" < $639)))  OR  (("stock_move__location_dest_id"."parent_left" >= $640)  AND  ("stock_move__location_dest_id"."parent_left" < $641)))  OR  (("stock_move__location_dest_id"."parent_left" >= $642)  AND  ("stock_move__location_dest_id"."parent_left" < $643)))  OR  (("stock_move__location_dest_id"."parent_left" >= $644)  AND  ("stock_move__location_dest_id"."parent_left" < $645)))  OR  (("stock_move__location_dest_id"."parent_left" >= $646)  AND  ("stock_move__location_dest_id"."parent_left" < $647)))  OR  (("stock_move__location_dest_id"."parent_left" >= $648)  AND  ("stock_move__location_dest_id"."parent_left" < $649)))  OR  (("stock_move__location_dest_id"."parent_left" >= $650)  AND  ("stock_move__location_dest_id"."parent_left" < $651)))  OR  (("stock_move__location_dest_id"."parent_left" >= $652)  AND  ("stock_move__location_dest_id"."parent_left" < $653))))  AND  ((((((((((((((("stock_move__location_id"."parent_left" < $654)  OR  ("stock_move__location_id"."parent_left" >= $655))  AND  (("stock_move__location_id"."parent_left" < $656)  OR  ("stock_move__location_id"."parent_left" >= $657)))  AND  (("stock_move__location_id"."parent_left" < $658)  OR  ("stock_move__location_id"."parent_left" >= $659)))  AND  (("stock_move__location_id"."parent_left" < $660)  OR  ("stock_move__location_id"."parent_left" >= $661)))  AND  (("stock_move__location_id"."parent_left" < $662)  OR  ("stock_move__location_id"."parent_left" >= $663)))  AND  (("stock_move__location_id"."parent_left" < $664)  OR  ("stock_move__location_id"."parent_left" >= $665)))  AND  (("stock_move__location_id"."parent_left" < $666)  OR  ("stock_move__location_id"."parent_left" >= $667)))  AND  (("stock_move__location_id"."parent_left" < $668)  OR  ("stock_move__location_id"."parent_left" >= $669)))  AND  (("stock_move__location_id"."parent_left" < $670)  OR  ("stock_move__location_id"."parent_left" >= $671)))  AND  (("stock_move__location_id"."parent_left" < $672)  OR  ("stock_move__location_id"."parent_left" >= $673)))  AND  (("stock_move__location_id"."parent_left" < $674)  OR  ("stock_move__location_id"."parent_left" >= $675)))  AND  (("stock_move__location_id"."parent_left" < $676)  OR  ("stock_move__location_id"."parent_left" >= $677)))  AND  (("stock_move__location_id"."parent_left" < $678)  OR  ("stock_move__location_id"."parent_left" >= $679)))  AND  (("stock_move__location_id"."parent_left" < $680)  OR  ("stock_move__location_id"."parent_left" >= $681))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
55 min < 0.1% 13,115 ms 251 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ('done','cancel','draft')) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in (900718,1004893,1004894,1029147,1006438,889236,889239,889242,889278,889310,889350,889369,1006704,889555,889570,1007671,889638,1007674,1007776,981124,889650,1007785,981128,889675,889680,889687,889696,981201,890089,981203,981205,981210,890123,981224,890129,890131,890142,890149,890152,1029834,981255,890165,1029837,1029836,890419,890430,890468,981281,890479,981284,981287,981322,981324,981325,981327,981328,981463,981464,1010202,981488,890979,1030052,890987,981563,981565,981569,981571,981573,981577,892007,981849,982059,982108,1030732,1030734,1030840,982211,1030846,982237,982243,1030851,982245,1030856,1030857,1030852,982343,1030933,901024,1031692,982454,901418,982518,1017680,1017683,902460,1018626,982582,982642,1018677,982656,982694,1029125,983013,983195,983197,1018755,983247,983253,983258,983271,983288,1018788,983299,1018794,983362,983365,983372,983373,983387,983388,983396,983404,1034514,983406,1034516,1034515,1034518,983416,1034519,1034517,983432,983434,1018823,983486,1018844,983638,905268,1018847,1018848,1018849,983646,1018850,983647,983711,983778,983823,1018883,983841,1018922,1018929,1018930,1019052,1019097,1019110,1019128,1019133,1019135,1019136,1019137,1019138,1019145,1019146,767640,1019149,910992,1019159,1019166,1019170,1019177,1019178,1019181,1019183,1019184,1019185,1019186,984021,1019213,1019214,1019329,911188,1019340,1019352,1019367,1019376,1019381,1019446,1019447,1019450,911251,1019493,1019510,1019520,1019524,1019531,1019534,1021881,1021882,1038841,984296,1039562,1021885,1039566,984309,1039565,984324,1039571,1039619,1039821,1039820,1039824,1040080,1040081,1040084,1040089,1040461,1040462,1040463,1021891,1040476,1040477,1043782,1021894,1045218,1045238,1045239,984620,1045824,984795,1050330,1050443,1050507,1050519,985158,985162,985169,985184,985385,1052506,985523,985534,1052538,985677,1052745,985696,985735,1053004,1053006,1053007,985749,985753,985756,985759,1053027,985763,1053030,1053031,985772,1053356,1053358,1053359,1053361,1053579,1053580,1053584,1053587,1053590,985877,985887,1053600,985907,1053692,1053693,1053950,986080,986120,986489,986699,986700,986701,986703,986704,979343,986705,986975,986981,987057,987058,987370,987372,987373,987637,987726,987805,979383,988157,979411,988880,989752,990840,991769,878758,878820,878983,878990,979671,879786,879826,879833,879841,926511,993599,993644,993995,879934,994060,880883,880888,881344,881345,979821,979825,979829,979830,979836,979838,881420,881738,881751,881781,979885,994506,930548,881838,881844,994533,994547,882282,882287,994688,994693,994699,994704,994714,994715,882568,882986,882999,883000,883005,883022,995565,883048,1020400,1021470,995892,1021475,1021481,996654,1021483,1021482,1021485,1021486,883071,996881,1021495,1021498,1021499,1021500,1021501,996892,1021508,996896,1021517,1021873,1021874,1021875,1021876,1021877,1021878,1021879,1021880,980438,980435,1021883,1021884,996925,1021886,1021887,1021888,980455,1021890,1021889,1021892,1021893,980457,1021895,980463,1021897,1021896,1021899,1021900,1021901,997835,1021902,1021904,1021905,1021903,980489,885705,1021906,1022151,1022518,1022519,1022520,1022522,1022523,886249,1022525,1022527,1022528,1022529,1022530,1022531,1022532,1022533,1022534,1022535,1022536,1022537,1022538,1022539,1022540,886272,1022542,1022547,1022548,1022551,1022552,886312,1022555,886303,1022541,1022559,1022560,1022561,1022558,1022557,1022695,980547,1022781,1022823,1022868,1022869,1022598,1022922,1022953,886461,1022965,886555,1022970,1022971,1022969,1022973,1022974,1022975,1022976,1023017,1023020,1023021,1023022,1022972,1023024,1023025,1023026,1023027,1023028,1023029,1023067,1023071,980602,1002146,1010150,1012972,1014065,1022060,1022924,1028981,1034228,1045336,1048007,1050107,1050935,1023195,1023205,1023207,1023208,1023261,1023262,1023263,1023265,1023425,1023583,1023587,1023590,887148,1023603,1023604,1023605,980656,1023607,1023609,1023608,1023612,1023616,1023618,1023619,1023620,1023621,980679,980660,980676,1023630,1023631,1023632,1023633,1023636,980694,1023639,1023640,1023644,1023645,887342,1023648,1023647,1023655,1023657,1023793,1023794,1023804,1023808,1023814,1023817,887389,1023825,1023849,1023850,1023852,1023920,1024016,999911,1024060,980760,1000097,1024106,1024110,1024111,1024112,1024109,999913,1024260,1024278,1000716,1024280,1024281,1024288,1024290,1024292,1024300,1024316,1024328,1024329,887456,1024331,1024340,1024339,980862,1001036,1024360,1024367,1024384,1024385,980866,1024369,980873,1025274,980881,1026913,1027084,1027103,1027270,1027362,1028061,980892,1028076,1028077,980896,980899,980902,888006,1028133,1028135,1028136,1028138,1028139,1028149,1028150,980924,980925,980931,888068,1028573,1002460,980938,1002668,980957,1028729,888180,888185,1004889,1004890,1004891,1004892)))  AND  (((("stock_move__location_dest_id"."parent_left" >= 2)  AND  ("stock_move__location_dest_id"."parent_left" < 3))  OR  (("stock_move__location_dest_id"."parent_left" >= 138)  AND  ("stock_move__location_dest_id"."parent_left" < 139)))  OR  ("stock_move"."location_dest_id" in (605))))  AND  (((("stock_move__location_id"."parent_left" < 2)  OR  ("stock_move__location_id"."parent_left" >= 3))  AND  (("stock_move__location_id"."parent_left" < 138)  OR  ("stock_move__location_id"."parent_left" >= 139)))  AND  (NOT (("stock_move"."location_id" in (605))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
55 min < 0.1% 17,289 ms 190 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_dest_id","stock_location" as "stock_move__location_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_dest_id"."parent_left" >= $594)  AND  ("stock_move__location_dest_id"."parent_left" < $595))  OR  (("stock_move__location_dest_id"."parent_left" >= $596)  AND  ("stock_move__location_dest_id"."parent_left" < $597)))  OR  ("stock_move"."location_dest_id" in ($598))))  AND  (((("stock_move__location_id"."parent_left" < $599)  OR  ("stock_move__location_id"."parent_left" >= $600))  AND  (("stock_move__location_id"."parent_left" < $601)  OR  ("stock_move__location_id"."parent_left" >= $602)))  AND  (NOT (("stock_move"."location_id" in ($603))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
55 min < 0.1% 8,498 ms 386 odoo
SELECT min("stock_move".id) AS id, count("stock_move".id) AS "product_id_count" , sum("stock_move"."product_qty") AS "product_qty" ,"stock_move"."product_id" as "product_id" 
            FROM "stock_location" as "stock_move__location_id","stock_location" as "stock_move__location_dest_id","stock_move"
            WHERE ("stock_move"."location_dest_id"="stock_move__location_dest_id"."id" AND "stock_move"."location_id"="stock_move__location_id"."id") AND ((((("stock_move"."state" not in ($1,$2,$3)) OR "stock_move"."state" IS NULL)  AND  ("stock_move"."product_id" in ($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)))  AND  (((("stock_move__location_id"."parent_left" >= $608)  AND  ("stock_move__location_id"."parent_left" < $609))  OR  (("stock_move__location_id"."parent_left" >= $610)  AND  ("stock_move__location_id"."parent_left" < $611)))  OR  ("stock_move"."location_id" in ($612))))  AND  (((("stock_move__location_dest_id"."parent_left" < $613)  OR  ("stock_move__location_dest_id"."parent_left" >= $614))  AND  (("stock_move__location_dest_id"."parent_left" < $615)  OR  ("stock_move__location_dest_id"."parent_left" >= $616)))  AND  (NOT (("stock_move"."location_dest_id" in ($617))))))
            GROUP BY "stock_move"."product_id"
            ORDER BY "id"
54 min < 0.1% 19 ms 169,655 odoo
UPDATE "stock_scrap" SET "scrap_qty"=$1,"write_uid"=$2,"write_date"=(now() at time zone $3) WHERE id IN ($4)
Covered by index on (id)
Rows: 123500
Row progression: 123500, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- move_id
- product_id
52 min < 0.1% 0 ms 22,476,956 odoo
SELECT "stock_quant"."id" as "id","stock_quant"."company_id" as "company_id","stock_quant"."product_id" as "product_id","stock_quant"."owner_id" as "owner_id","stock_quant"."reserved_quantity" as "reserved_quantity","stock_quant"."create_uid" as "create_uid","stock_quant"."write_date" as "write_date","stock_quant"."package_id" as "package_id","stock_quant"."quantity" as "quantity","stock_quant"."removal_date" as "removal_date","stock_quant"."commissary_reserved" as "commissary_reserved","stock_quant"."create_date" as "create_date","stock_quant"."lot_id" as "lot_id","stock_quant"."in_date" as "in_date","stock_quant"."location_id" as "location_id","stock_quant"."write_uid" as "write_uid","stock_quant"."commissary_quantity" as "commissary_quantity" FROM "stock_quant" WHERE "stock_quant".id IN ($1)
Covered by index on (id)
Rows: 2922664
Row progression: 2922664, 1

Row estimates
- id (=): 1

Existing indexes
- id PRIMARY
- lot_id
- product_id