explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pZWo

Settings
# exclusive inclusive rows x rows loops node
1. 0.645 26.654 ↑ 1.0 200 1

GroupAggregate (cost=14,509.46..14,524.61 rows=200 width=72) (actual time=25.973..26.654 rows=200 loops=1)

  • Group Key: rests_item.id
2. 0.286 26.009 ↓ 3.1 1,009 1

Sort (cost=14,509.46..14,510.27 rows=324 width=1,082) (actual time=25.957..26.009 rows=1,009 loops=1)

  • Sort Key: rests_item.id
  • Sort Method: quicksort Memory: 154kB
3. 2.186 25.723 ↓ 3.1 1,009 1

Hash Right Join (cost=13,246.84..14,495.95 rows=324 width=1,082) (actual time=25.549..25.723 rows=1,009 loops=1)

  • Hash Cond: (mov_item.rests_item_id = rests_item.id)
4. 3.919 13.233 ↑ 1.0 20,773 1

Hash Join (cost=217.23..1,361.80 rows=20,903 width=537) (actual time=0.604..13.233 rows=20,773 loops=1)

  • Hash Cond: (mi.egais_status_id = es.id)
5. 5.733 9.300 ↑ 1.0 20,773 1

Hash Join (cost=215.78..1,293.86 rows=20,903 width=29) (actual time=0.579..9.300 rows=20,773 loops=1)

  • Hash Cond: (mov_item.movement_invoice_id = mi.id)
6. 2.997 2.997 ↑ 1.0 20,773 1

Seq Scan on movement_invoice_item mov_item (cost=0.00..1,023.03 rows=20,903 width=21) (actual time=0.003..2.997 rows=20,773 loops=1)

7. 0.170 0.570 ↑ 1.0 1,279 1

Hash (cost=199.79..199.79 rows=1,279 width=24) (actual time=0.570..0.570 rows=1,279 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 86kB
8. 0.400 0.400 ↑ 1.0 1,279 1

Seq Scan on movement_invoice mi (cost=0.00..199.79 rows=1,279 width=24) (actual time=0.003..0.400 rows=1,279 loops=1)

9. 0.004 0.014 ↓ 1.1 21 1

Hash (cost=1.20..1.20 rows=20 width=524) (actual time=0.014..0.014 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
10. 0.010 0.010 ↓ 1.1 21 1

Seq Scan on egais_status es (cost=0.00..1.20 rows=20 width=524) (actual time=0.007..0.010 rows=21 loops=1)

11. 0.308 10.304 ↓ 3.1 1,009 1

Hash (cost=13,025.56..13,025.56 rows=324 width=553) (actual time=10.304..10.304 rows=1,009 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 98kB
12. 0.341 9.996 ↓ 3.1 1,009 1

Nested Loop Left Join (cost=2.13..13,025.56 rows=324 width=553) (actual time=0.070..9.996 rows=1,009 loops=1)

13. 0.029 1.055 ↑ 1.0 200 1

Nested Loop (cost=0.72..2,985.95 rows=200 width=16) (actual time=0.047..1.055 rows=200 loops=1)

14. 0.626 0.626 ↑ 1.0 200 1

Index Scan using rests_item_pkey on rests_item (cost=0.43..1,689.45 rows=200 width=16) (actual time=0.038..0.626 rows=200 loops=1)

  • Index Cond: (id = ANY ('{2543139,2742828,1994776,1595401,2746942,2344962,2495492,1318972,2754560,2445332,1599018,2755096,2416145,2354709,2441235,2145816,1554477,2145818,2145819,1318952,2755095,2235491,2518628,2628202,2628203,1707100,2653793,2682466,2681976,2717822,2511484,2511485,2511483,2705481,2705480,2705482,2753103,2705477,2705476,2705479,2705478,1576556,2339419,2753104,1380500,1633945,1598618,2375335,1633948,2447009,1598623,2447010,1618568,1654923,1654922,1783436,1708677,2725513,2091193,2412674,2303620,2286738,2238096,1999530,2238102,1686703,2238100,2238101,2419859,2286744,2445982,2655380,2644629,2644630,2327783,2222312,2710240,2222315,2720483,2222314,2720482,2302701,2222318,2512626,2715378,1521865,1692871,1521864,2320067,2320066,2320065,2320071,2320070,2320075,2320074,2320073,2738883,2320079,2320078,2320077,2320076,2174160,2354385,1612011,2730717,2730719,2509521,2162908,2591449,2162910,2710230,2500900,2500901,1612572,2500899,2543404,2712888,2700593,2498879,2700592,2351367,2580239,2580238,2351368,2580234,2499849,2546462,1608997,2202983,2202982,2339691,2339695,2421096,2339699,2483573,2339698,2483572,2339696,2339702,2483571,1650499,1650501,1650503,2519928,2259266,1794410,2506580,2198354,2506581,2506578,2198356,2506579,1605985,2582875,2710869,2472792,1664411,2460071,2327968,1664413,2648505,1620875,2006408,2112385,2323329,2459015,2297230,1645992,1645996,2614686,2614685,2141084,1318826,2141086,2341349,1792979,1631698,1631699,2384361,2591720,2580471,2384375,2388977,2069443,2300927,2411460,1428983,2400710,2476993,2528706,2411457,2411458,2411459,2520012,2551756,2411465,2318285,1730037,1660911,2246110}'::bigint[]))
15. 0.400 0.400 ↑ 1.0 1 200

Index Scan using legal_person_pkey on legal_person (cost=0.29..6.48 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=200)

  • Index Cond: (id = rests_item.legal_person_id)
16. 0.800 8.600 ↑ 1.2 5 200

Nested Loop Left Join (cost=1.41..50.14 rows=6 width=545) (actual time=0.010..0.043 rows=5 loops=200)

17. 0.000 7.800 ↑ 1.2 5 200

Nested Loop (cost=1.28..49.19 rows=6 width=559) (actual time=0.009..0.039 rows=5 loops=200)

18. 0.391 5.800 ↑ 1.2 5 200

Nested Loop Left Join (cost=0.99..32.05 rows=6 width=559) (actual time=0.007..0.029 rows=5 loops=200)

19. 1.182 4.400 ↑ 1.2 5 200

Nested Loop (cost=0.85..31.12 rows=6 width=51) (actual time=0.005..0.022 rows=5 loops=200)

20. 1.200 1.200 ↑ 1.2 5 200

Index Scan using idx_egais_act_item_rests_item_id on egais_act_item act_item (cost=0.43..13.04 rows=6 width=27) (actual time=0.003..0.006 rows=5 loops=200)

  • Index Cond: (rests_item.id = rests_item_id)
21. 2.018 2.018 ↑ 1.0 1 1,009

Index Scan using egais_act_pkey on egais_act (cost=0.42..3.01 rows=1 width=48) (actual time=0.002..0.002 rows=1 loops=1,009)

  • Index Cond: (id = act_item.egais_act_id)
22. 1.009 1.009 ↑ 1.0 1 1,009

Index Scan using egais_status_pkey on egais_status store_status (cost=0.14..0.16 rows=1 width=524) (actual time=0.001..0.001 rows=1 loops=1,009)

  • Index Cond: (egais_act.store_act_status_id = id)
23. 2.018 2.018 ↑ 1.0 1 1,009

Index Scan using legal_person_pkey on legal_person lp (cost=0.29..2.86 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=1,009)

  • Index Cond: (id = egais_act.legal_person_id)
24. 0.000 0.000 ↓ 0.0 0 1,009

Index Scan using egais_status_pkey on egais_status shop_status (cost=0.14..0.16 rows=1 width=524) (actual time=0.000..0.000 rows=0 loops=1,009)

  • Index Cond: (egais_act.shop_act_status_id = id)
Planning time : 2.319 ms
Execution time : 26.780 ms