explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qE5S

Settings
# exclusive inclusive rows x rows loops node
1. 1,682.547 36,747.429 ↓ 5,017.0 3,070,389 1

Hash Join (cost=19,312.29..73,485.70 rows=612 width=64) (actual time=26,961.120..36,747.429 rows=3,070,389 loops=1)

  • Hash Cond: ((y."FinancialYear" = fb."FinancialYear") AND (ft."TransactionId" = fb."TransactionId"))
2. 1,565.346 34,984.519 ↓ 346.1 9,750,031 1

Hash Join (cost=6,270.59..60,217.42 rows=28,170 width=68) (actual time=26,880.426..34,984.519 rows=9,750,031 loops=1)

  • Hash Cond: (b."YearlyBalanceLookupId" = bt."BalanceTypeId")
3. 2,068.182 33,419.129 ↓ 346.1 9,750,031 1

Hash Join (cost=6,269.46..60,114.46 rows=28,170 width=52) (actual time=26,880.356..33,419.129 rows=9,750,031 loops=1)

  • Hash Cond: (c."Id" = b."CellId")
4. 1,557.167 31,329.642 ↓ 477.4 9,750,031 1

Hash Join (cost=5,283.94..58,666.94 rows=20,424 width=36) (actual time=26,858.966..31,329.642 rows=9,750,031 loops=1)

  • Hash Cond: (m."Id" = c."MappingId")
5. 2,865.477 29,755.919 ↓ 403.7 4,264,915 1

Hash Join (cost=4,495.22..57,516.67 rows=10,564 width=52) (actual time=26,842.313..29,755.919 rows=4,264,915 loops=1)

  • Hash Cond: (ft."ItemId" = mi."ItemMscoaId")
6. 72.170 78.178 ↑ 1.0 41,522 1

Bitmap Heap Scan on "FlattenedTransactions" ft (cost=1,163.68..53,870.94 rows=41,711 width=32) (actual time=6.670..78.178 rows=41,522 loops=1)

  • Recheck Cond: ("EntityId" = 'b787799f-4826-4f8a-9593-686999e54c9f'::uuid)
  • Heap Blocks: exact=5037
7. 6.008 6.008 ↑ 1.0 41,522 1

Bitmap Index Scan on "IX_FlattenedTransactions_EntityId" (cost=0.00..1,153.25 rows=41,711 width=0) (actual time=6.008..6.008 rows=41,522 loops=1)

  • Index Cond: ("EntityId" = 'b787799f-4826-4f8a-9593-686999e54c9f'::uuid)
8. 2,443.283 26,812.264 ↓ 656.1 5,964,789 1

Hash (cost=3,217.90..3,217.90 rows=9,091 width=52) (actual time=26,812.264..26,812.264 rows=5,964,789 loops=1)

  • Buckets: 65536 (originally 16384) Batches: 256 (originally 1) Memory Usage: 3585kB
9. 554.556 24,368.981 ↓ 656.1 5,964,789 1

Nested Loop (cost=20.51..3,217.90 rows=9,091 width=52) (actual time=2.914..24,368.981 rows=5,964,789 loops=1)

10. 3.981 21.919 ↓ 455.5 6,833 1

Hash Join (cost=19.95..490.58 rows=15 width=20) (actual time=1.703..21.919 rows=6,833 loops=1)

  • Hash Cond: (m."Year" = y."Year")
11. 5.945 17.924 ↓ 455.5 6,833 1

Hash Join (cost=19.76..490.18 rows=15 width=20) (actual time=1.680..17.924 rows=6,833 loops=1)

  • Hash Cond: (m."WorkbookId" = wb."Id")
12. 11.951 11.951 ↑ 1.0 9,842 1

Seq Scan on "Mapping" m (cost=0.00..444.42 rows=9,842 width=36) (actual time=1.635..11.951 rows=9,842 loops=1)

13. 0.003 0.028 ↑ 1.0 1 1

Hash (cost=19.75..19.75 rows=1 width=16) (actual time=0.028..0.028 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.025 0.025 ↑ 1.0 1 1

Seq Scan on "Workbook" wb (cost=0.00..19.75 rows=1 width=16) (actual time=0.024..0.025 rows=1 loops=1)

  • Filter: (("EntityId" = 'b787799f-4826-4f8a-9593-686999e54c9f'::uuid) AND ("Name" = 'AFS 2019.xlsx'::text))
  • Rows Removed by Filter: 2
15. 0.002 0.014 ↑ 1.0 3 1

Hash (cost=0.15..0.15 rows=3 width=8) (actual time=0.014..0.014 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.001 0.012 ↑ 1.0 3 1

Subquery Scan on y (cost=0.09..0.15 rows=3 width=8) (actual time=0.011..0.012 rows=3 loops=1)

17. 0.008 0.011 ↑ 1.0 3 1

HashAggregate (cost=0.09..0.12 rows=3 width=8) (actual time=0.009..0.011 rows=3 loops=1)

  • Group Key: (2017), (1)
18. 0.001 0.003 ↑ 1.0 3 1

Append (cost=0.00..0.07 rows=3 width=8) (actual time=0.002..0.003 rows=3 loops=1)

19. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1)

20. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)

21. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=1)

22. 23,792.506 23,792.506 ↑ 6.0 873 6,833

Index Only Scan using "PK_MappingItem" on "MappingItem" mi (cost=0.56..129.45 rows=5,237 width=32) (actual time=0.095..3.482 rows=873 loops=6,833)

  • Index Cond: ("MappingId" = m."Id")
  • Heap Fetches: 5964789
23. 2.833 16.556 ↑ 1.0 18,921 1

Hash (cost=552.21..552.21 rows=18,921 width=32) (actual time=16.556..16.556 rows=18,921 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1439kB
24. 13.723 13.723 ↑ 1.0 18,921 1

Seq Scan on "Cell" c (cost=0.00..552.21 rows=18,921 width=32) (actual time=6.613..13.723 rows=18,921 loops=1)

25. 3.822 21.305 ↑ 1.0 26,245 1

Hash (cost=657.45..657.45 rows=26,245 width=32) (actual time=21.305..21.305 rows=26,245 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1706kB
26. 17.483 17.483 ↑ 1.0 26,245 1

Seq Scan on "Balance" b (cost=0.00..657.45 rows=26,245 width=32) (actual time=0.574..17.483 rows=26,245 loops=1)

27. 0.010 0.044 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=48) (actual time=0.044..0.044 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
28. 0.034 0.034 ↑ 1.0 6 1

Seq Scan on "LookupBalanceTypes" bt (cost=0.00..1.06 rows=6 width=48) (actual time=0.032..0.034 rows=6 loops=1)

29. 12.958 80.363 ↓ 1.3 41,522 1

Hash (cost=12,572.47..12,572.47 rows=31,282 width=43) (actual time=80.363..80.363 rows=41,522 loops=1)

  • Buckets: 65536 (originally 32768) Batches: 1 (originally 1) Memory Usage: 3704kB
30. 13.621 67.405 ↓ 1.3 41,522 1

Hash Join (cost=1,163.86..12,572.47 rows=31,282 width=43) (actual time=35.478..67.405 rows=41,522 loops=1)

  • Hash Cond: (fb."FinancialYear" = y_1."FinancialYear")
31. 18.681 53.773 ↑ 1.0 41,522 1

Bitmap Heap Scan on "FlattenedBalances" fb (cost=1,163.67..12,103.05 rows=41,710 width=39) (actual time=35.456..53.773 rows=41,522 loops=1)

  • Recheck Cond: ("EntityId" = 'b787799f-4826-4f8a-9593-686999e54c9f'::uuid)
  • Heap Blocks: exact=991
32. 35.092 35.092 ↑ 1.0 41,522 1

Bitmap Index Scan on "IX_FlattenedBalances_EntityId" (cost=0.00..1,153.25 rows=41,710 width=0) (actual time=35.092..35.092 rows=41,522 loops=1)

  • Index Cond: ("EntityId" = 'b787799f-4826-4f8a-9593-686999e54c9f'::uuid)
33. 0.004 0.011 ↑ 1.0 3 1

Hash (cost=0.15..0.15 rows=3 width=4) (actual time=0.011..0.011 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
34. 0.001 0.007 ↑ 1.0 3 1

Subquery Scan on y_1 (cost=0.09..0.15 rows=3 width=4) (actual time=0.007..0.007 rows=3 loops=1)

35. 0.004 0.006 ↑ 1.0 3 1

HashAggregate (cost=0.09..0.12 rows=3 width=8) (actual time=0.006..0.006 rows=3 loops=1)

  • Group Key: (2017), (1)
36. 0.000 0.002 ↑ 1.0 3 1

Append (cost=0.00..0.07 rows=3 width=8) (actual time=0.001..0.002 rows=3 loops=1)

37. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)

38. 0.000 0.000 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=1)

39. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)

Planning time : 19.941 ms