explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HiAf

Settings
# exclusive inclusive rows x rows loops node
1. 0.168 219.545 ↑ 79.6 39 1

Sort (cost=52,433.40..52,441.16 rows=3,104 width=120) (actual time=219.539..219.545 rows=39 loops=1)

  • Sort Key: data_tags.fs_template, xbrl_tags.tag, (round(sum((power((date_part('days'::text, (now() - (fundamentals.end_date)::timestamp with time zone)) / '366'::double precision), '2'::double precision))::numeric), 2)) DESC
  • Sort Method: quicksort Memory: 30kB
2. 7.450 219.377 ↑ 79.6 39 1

GroupAggregate (cost=52,105.93..52,253.37 rows=3,104 width=120) (actual time=211.514..219.377 rows=39 loops=1)

  • Group Key: data_tags.fs_template, xbrl_tags.tag, data_tags.tag, data_tags.statement_code
3. 9.661 211.927 ↓ 1.0 3,193 1

Sort (cost=52,105.93..52,113.69 rows=3,104 width=88) (actual time=211.476..211.927 rows=3,193 loops=1)

  • Sort Key: data_tags.fs_template, xbrl_tags.tag, data_tags.tag, data_tags.statement_code
  • Sort Method: quicksort Memory: 554kB
4. 1.535 202.266 ↓ 1.0 3,193 1

Hash Join (cost=44,790.79..51,925.90 rows=3,104 width=88) (actual time=67.297..202.266 rows=3,193 loops=1)

  • Hash Cond: (historical_data.fundamental_id = fundamentals.id)
5. 1.730 193.817 ↓ 1.0 3,193 1

Hash Join (cost=44,334.35..51,426.78 rows=3,104 width=92) (actual time=60.365..193.817 rows=3,193 loops=1)

  • Hash Cond: (historical_data.data_tag_id = data_tags.id)
6. 6.165 188.672 ↓ 1.0 3,193 1

Nested Loop (cost=44,093.99..51,143.74 rows=3,104 width=50) (actual time=56.935..188.672 rows=3,193 loops=1)

7. 50.336 126.758 ↓ 3.3 18,583 1

Hash Join (cost=44,093.57..48,344.47 rows=5,662 width=42) (actual time=56.659..126.758 rows=18,583 loops=1)

  • Hash Cond: (raw_historical_data.xbrl_tag_id = xbrl_tags.id)
8. 19.936 19.936 ↓ 1.0 185,924 1

Seq Scan on raw_historical_data (cost=0.00..3,497.66 rows=185,766 width=12) (actual time=0.007..19.936 rows=185,924 loops=1)

9. 15.975 56.486 ↓ 1.2 38,510 1

Hash (cost=43,705.20..43,705.20 rows=31,070 width=42) (actual time=56.486..56.486 rows=38,510 loops=1)

  • Buckets: 65536 (originally 32768) Batches: 1 (originally 1) Memory Usage: 3064kB
10. 27.645 40.511 ↓ 1.2 38,510 1

Bitmap Heap Scan on xbrl_tags (cost=2,723.20..43,705.20 rows=31,070 width=42) (actual time=15.368..40.511 rows=38,510 loops=1)

  • Recheck Cond: (tag = ANY ('{RevenueFromContractWithCustomerExcludingAssessedTax,CostOfGoodsAndServicesSold,SellingGeneralAndAdministrativeExpense,CostsAndExpenses,OperatingIncomeLoss,InvestmentIncomeInterest,InterestAndDebtExpense,OtherNonoperatingIncomeExpense,IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest,IncomeTaxExpenseBenefit,IncomeLossFromContinuingOperations,IncomeLossFromDiscontinuedOperationsNetOfTax,NetIncomeLoss,IncomeLossFromContinuingOperationsPerBasicShare,DiscontinuedOperationIncomeLossFromDiscontinuedOperationNetOfTaxPerBasicShare,EarningsPerShareBasic,IncomeLossFromContinuingOperationsPerDilutedShare,DiscontinuedOperationIncomeLossFromDiscontinuedOperationNetOfTaxPerDilutedShare,EarningsPerShareDiluted}'::text[]))
  • Heap Blocks: exact=9411
11. 12.866 12.866 ↓ 1.7 51,540 1

Bitmap Index Scan on xbrl_tags_tag_index (cost=0.00..2,715.44 rows=31,070 width=0) (actual time=12.866..12.866 rows=51,540 loops=1)

  • Index Cond: (tag = ANY ('{RevenueFromContractWithCustomerExcludingAssessedTax,CostOfGoodsAndServicesSold,SellingGeneralAndAdministrativeExpense,CostsAndExpenses,OperatingIncomeLoss,InvestmentIncomeInterest,InterestAndDebtExpense,OtherNonoperatingIncomeExpense,IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest,IncomeTaxExpenseBenefit,IncomeLossFromContinuingOperations,IncomeLossFromDiscontinuedOperationsNetOfTax,NetIncomeLoss,IncomeLossFromContinuingOperationsPerBasicShare,DiscontinuedOperationIncomeLossFromDiscontinuedOperationNetOfTaxPerBasicShare,EarningsPerShareBasic,IncomeLossFromContinuingOperationsPerDilutedShare,DiscontinuedOperationIncomeLossFromDiscontinuedOperationNetOfTaxPerDilutedShare,EarningsPerShareDiluted}'::text[]))
12. 55.749 55.749 ↓ 0.0 0 18,583

Index Scan using historical_data_raw_historical_data_id_index on historical_data (cost=0.42..0.48 rows=1 width=20) (actual time=0.003..0.003 rows=0 loops=18,583)

  • Index Cond: (raw_historical_data_id = raw_historical_data.id)
13. 1.768 3.415 ↑ 1.0 4,958 1

Hash (cost=176.27..176.27 rows=5,127 width=50) (actual time=3.415..3.415 rows=4,958 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 454kB
14. 1.647 1.647 ↑ 1.0 4,958 1

Seq Scan on data_tags (cost=0.00..176.27 rows=5,127 width=50) (actual time=0.011..1.647 rows=4,958 loops=1)

15. 3.259 6.914 ↑ 1.0 10,813 1

Hash (cost=320.64..320.64 rows=10,864 width=8) (actual time=6.914..6.914 rows=10,813 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 551kB
16. 3.655 3.655 ↑ 1.0 10,813 1

Seq Scan on fundamentals (cost=0.00..320.64 rows=10,864 width=8) (actual time=0.014..3.655 rows=10,813 loops=1)

Planning time : 3.291 ms
Execution time : 219.888 ms