explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xbtSD

Settings
# exclusive inclusive rows x rows loops node
1. 3,708.883 44,443.438 ↓ 440.9 3,070,389 1

Hash Join (cost=60,639.97..77,458.35 rows=6,964 width=64) (actual time=41,057.024..44,443.438 rows=3,070,389 loops=1)

  • Hash Cond: ((fb."TransactionId" = fti."TransactionId") AND (fb."FinancialYear" = y."FinancialYear"))
2. 439.148 439.148 ↑ 1.0 355,787 1

Seq Scan on "FlattenedBalances" fb (cost=0.00..13,975.87 rows=355,787 width=39) (actual time=0.494..439.148 rows=355,787 loops=1)

3. 3,427.986 40,295.407 ↓ 346.1 9,750,031 1

Hash (cost=60,217.42..60,217.42 rows=28,170 width=68) (actual time=40,295.407..40,295.407 rows=9,750,031 loops=1)

  • Buckets: 65536 (originally 32768) Batches: 256 (originally 1) Memory Usage: 3585kB
4. 2,050.560 36,867.421 ↓ 346.1 9,750,031 1

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

  • Hash Cond: (b."YearlyBalanceLookupId" = bt."BalanceTypeId")
5. 2,963.183 34,816.824 ↓ 346.1 9,750,031 1

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

  • Hash Cond: (c."Id" = b."CellId")
6. 2,074.769 31,834.905 ↓ 477.4 9,750,031 1

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

  • Hash Cond: (m."Id" = c."MappingId")
7. 3,316.362 29,747.060 ↓ 403.7 4,264,915 1

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

  • Hash Cond: (fti."ItemId" = mi."ItemMscoaId")
8. 73.798 78.243 ↑ 1.0 41,522 1

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

  • Recheck Cond: ("EntityId" = 'b787799f-4826-4f8a-9593-686999e54c9f'::uuid)
  • Heap Blocks: exact=5037
9. 4.445 4.445 ↑ 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=4.445..4.445 rows=41,522 loops=1)

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

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

  • Buckets: 65536 (originally 16384) Batches: 256 (originally 1) Memory Usage: 3585kB
11. 532.916 23,935.302 ↓ 656.1 5,964,789 1

Nested Loop (cost=20.51..3,217.90 rows=9,091 width=52) (actual time=3.423..23,935.302 rows=5,964,789 loops=1)

12. 3.865 19.860 ↓ 455.5 6,833 1

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

  • Hash Cond: (m."Year" = y."Year")
13. 5.449 15.981 ↓ 455.5 6,833 1

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

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

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

15. 0.003 0.022 ↑ 1.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.019 0.019 ↑ 1.0 1 1

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

  • Filter: (("EntityId" = 'b787799f-4826-4f8a-9593-686999e54c9f'::uuid) AND ("Name" = 'AFS 2019.xlsx'::text))
  • Rows Removed by Filter: 2
17. 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
18. 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)

19. 0.008 0.011 ↑ 1.0 3 1

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

  • Group Key: (2017), (1)
20. 0.002 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)

21. 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)

22. 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)

23. 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)

24. 23,382.526 23,382.526 ↑ 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.117..3.422 rows=873 loops=6,833)

  • Index Cond: ("MappingId" = m."Id")
  • Heap Fetches: 5964789
25. 2.411 13.076 ↑ 1.0 18,921 1

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

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

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

27. 3.775 18.736 ↑ 1.0 26,245 1

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

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

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

29. 0.005 0.037 ↑ 1.0 6 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
30. 0.032 0.032 ↑ 1.0 6 1

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

Planning time : 18.146 ms