explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9dBJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 2,338.522 ↓ 1.8 66,375 1

Append (cost=21,934.71..69,706.67 rows=37,910 width=318) (actual time=380.863..2,338.522 rows=66,375 loops=1)

2. 475.882 475.882 ↑ 4,192.3 9 1

Hash Join (cost=21,934.71..30,780.91 rows=37,731 width=267) (actual time=380.863..475.882 rows=9 loops=1)

3. 475.690 475.690 ↑ 4,308.2 9 1

Hash Join (cost=21,920.20..29,206.09 rows=38,774 width=246) (actual time=380.722..475.690 rows=9 loops=1)

4. 474.126 474.126 ↑ 4,434.9 9 1

Hash Join (cost=21,665.82..28,414.29 rows=39,914 width=219) (actual time=379.171..474.126 rows=9 loops=1)

5. 471.105 471.105 ↑ 4,340.3 10 1

Hash Right Join (cost=21,373.07..27,559.62 rows=43,403 width=215) (actual time=376.165..471.105 rows=10 loops=1)

6. 198.122 198.122 ↑ 1.0 76,669 1

Subquery Scan on v (cost=12,469.38..15,344.69 rows=76,675 width=72) (actual time=116.813..198.122 rows=76,669 loops=1)

7. 188.682 188.682 ↑ 1.0 76,669 1

GroupAggregate (cost=12,469.38..14,577.94 rows=76,675 width=20) (actual time=116.812..188.682 rows=76,669 loops=1)

8. 134.857 134.857 ↓ 1.0 76,684 1

Sort (cost=12,469.38..12,661.06 rows=76,675 width=20) (actual time=116.797..134.857 rows=76,684 loops=1)

9. 57.116 57.116 ↓ 1.0 76,684 1

Hash Join (cost=409.46..4,673.55 rows=76,675 width=20) (actual time=3.972..57.116 rows=76,684 loops=1)

10. 31.626 31.626 ↓ 1.0 76,684 1

Seq Scan on cost_row cr (cost=0.00..3,209.81 rows=76,675 width=20) (actual time=0.011..31.626 rows=76,684 loops=1)

11. 3.936 3.936 ↓ 1.0 13,578 1

Hash (cost=239.76..239.76 rows=13,576 width=8) (actual time=3.936..3.936 rows=13,578 loops=1)

12. 2.090 2.090 ↓ 1.0 13,578 1

Seq Scan on cost_sheet cs (cost=0.00..239.76 rows=13,576 width=8) (actual time=0.006..2.090 rows=13,578 loops=1)

13. 151.092 151.092 ↓ 2.2 94,774 1

Hash (cost=7,311.38..7,311.38 rows=43,621 width=151) (actual time=151.092..151.092 rows=94,774 loops=1)

14. 85.856 85.856 ↓ 2.2 94,774 1

Hash Join (cost=189.83..7,311.38 rows=43,621 width=151) (actual time=1.663..85.856 rows=94,774 loops=1)

15. 55.148 55.148 ↓ 1.4 94,774 1

Seq Scan on import_invoice_row imir (cost=0.00..6,438.60 rows=65,796 width=138) (actual time=0.008..55.148 rows=94,774 loops=1)

16. 1.634 1.634 ↑ 1.0 4,437 1

Hash (cost=134.37..134.37 rows=4,437 width=17) (actual time=1.634..1.634 rows=4,437 loops=1)

17. 0.842 0.842 ↑ 1.0 4,437 1

Seq Scan on contract c (cost=0.00..134.37 rows=4,437 width=17) (actual time=0.002..0.842 rows=4,437 loops=1)

18. 2.983 2.983 ↑ 1.0 5,471 1

Hash (cost=224.36..224.36 rows=5,471 width=8) (actual time=2.983..2.983 rows=5,471 loops=1)

19. 2.210 2.210 ↑ 1.0 5,471 1

Seq Scan on import_invoice imin (cost=0.00..224.36 rows=5,471 width=8) (actual time=0.007..2.210 rows=5,471 loops=1)

20. 1.540 1.540 ↑ 1.0 3,128 1

Hash (cost=215.28..215.28 rows=3,128 width=35) (actual time=1.540..1.540 rows=3,128 loops=1)

21. 0.939 0.939 ↑ 1.0 3,128 1

Seq Scan on property p (cost=0.00..215.28 rows=3,128 width=35) (actual time=0.004..0.939 rows=3,128 loops=1)

22. 0.119 0.119 ↑ 1.0 245 1

Hash (cost=11.45..11.45 rows=245 width=25) (actual time=0.119..0.119 rows=245 loops=1)

23. 0.075 0.075 ↑ 1.0 245 1

Seq Scan on item i (cost=0.00..11.45 rows=245 width=25) (actual time=0.006..0.075 rows=245 loops=1)

24. 1,855.066 1,855.066 ↓ 370.8 66,366 1

Nested Loop (cost=35,226.15..38,546.66 rows=179 width=228) (actual time=1,388.175..1,855.066 rows=66,366 loops=1)

25. 1,578.103 1,578.103 ↓ 370.8 66,366 1

Merge Right Join (cost=35,225.87..38,485.92 rows=179 width=236) (actual time=1,388.127..1,578.103 rows=66,366 loops=1)

26. 183.616 183.616 ↑ 1.0 75,113 1

GroupAggregate (cost=12,469.38..14,577.94 rows=76,675 width=20) (actual time=114.861..183.616 rows=75,113 loops=1)

27. 133.189 133.189 ↑ 1.0 75,129 1

Sort (cost=12,469.38..12,661.06 rows=76,675 width=20) (actual time=114.845..133.189 rows=75,129 loops=1)

28. 55.183 55.183 ↓ 1.0 76,684 1

Hash Join (cost=409.46..4,673.55 rows=76,675 width=20) (actual time=3.991..55.183 rows=76,684 loops=1)

29. 30.303 30.303 ↓ 1.0 76,684 1

Seq Scan on cost_row cr_1 (cost=0.00..3,209.81 rows=76,675 width=20) (actual time=0.020..30.303 rows=76,684 loops=1)

30. 3.947 3.947 ↓ 1.0 13,578 1

Hash (cost=239.76..239.76 rows=13,576 width=8) (actual time=3.947..3.947 rows=13,578 loops=1)

31. 2.101 2.101 ↓ 1.0 13,578 1

Seq Scan on cost_sheet cs_1 (cost=0.00..239.76 rows=13,576 width=8) (actual time=0.007..2.101 rows=13,578 loops=1)

32. 1,315.571 1,315.571 ↓ 436.3 78,533 1

Sort (cost=22,756.49..22,756.94 rows=180 width=172) (actual time=1,273.232..1,315.571 rows=78,533 loops=1)

33. 1,080.032 1,080.032 ↓ 436.3 78,533 1

Nested Loop (cost=20,886.02..22,749.75 rows=180 width=172) (actual time=448.390..1,080.032 rows=78,533 loops=1)

34. 860.208 860.208 ↓ 401.7 78,727 1

Hash Join (cost=20,885.74..22,686.37 rows=196 width=168) (actual time=448.348..860.208 rows=78,727 loops=1)

35. 785.762 785.762 ↓ 46.1 422,741 1

Merge Join (cost=20,870.62..22,600.57 rows=9,162 width=151) (actual time=448.208..785.762 rows=422,741 loops=1)

36. 435.167 435.167 ↑ 1.0 60,109 1

Sort (cost=15,641.75..15,797.19 rows=62,178 width=134) (actual time=301.592..435.167 rows=60,109 loops=1)

37. 123.425 123.425 ↓ 1.0 62,508 1

Seq Scan on import_invoice_row imir_1 (cost=0.00..6,438.60 rows=62,178 width=134) (actual time=0.035..123.425 rows=62,508 loops=1)

38. 199.909 199.909 ↓ 10.4 434,565 1

Materialize (cost=5,228.45..5,437.82 rows=41,874 width=25) (actual time=146.522..199.909 rows=434,565 loops=1)

39. 166.150 166.150 ↓ 1.0 41,925 1

Sort (cost=5,228.45..5,333.13 rows=41,874 width=25) (actual time=146.519..166.150 rows=41,925 loops=1)

40. 34.511 34.511 ↓ 1.0 41,926 1

Seq Scan on contract_item_rate coir (cost=0.00..1,009.33 rows=41,874 width=25) (actual time=0.019..34.511 rows=41,926 loops=1)

41. 0.113 0.113 ↑ 1.1 215 1

Hash (cost=11.45..11.45 rows=245 width=29) (actual time=0.113..0.113 rows=215 loops=1)

42. 0.066 0.066 ↑ 1.0 245 1

Seq Scan on item i_1 (cost=0.00..11.45 rows=245 width=29) (actual time=0.007..0.066 rows=245 loops=1)

43. 157.454 157.454 ↑ 1.0 1 78,727

Index Scan using import_invoice_pkey on import_invoice imin_1 (cost=0.28..0.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=78,727)

44. 132.732 132.732 ↑ 1.0 1 66,366

Index Only Scan using property_pkey on property p_1 (cost=0.28..0.30 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=66,366)