explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DzV

Settings
# exclusive inclusive rows x rows loops node
1. 0.425 2,314.546 ↑ 16.1 571 1

Sort (cost=22,385.94..22,388.23 rows=9,182 width=140) (actual time=2,314.451..2,314.546 rows=571 loops=1)

  • Sort Key: tb_company_action.dt_limit
  • Sort Method: quicksort Memory: 99kB
2. 0.071 2,314.121 ↑ 16.1 571 1

Append (cost=352.95..22,325.50 rows=9,182 width=140) (actual time=7.262..2,314.121 rows=571 loops=1)

3. 0.388 51.215 ↑ 37.0 248 1

Hash Join (cost=352.95..5,009.10 rows=9,180 width=140) (actual time=7.260..51.215 rows=248 loops=1)

  • Hash Cond: (tb_company_action.id_company_action_type = tb_company_action_type.id_company_action_type)
4.          

Initplan (for Hash Join)

5. 0.001 0.093 ↑ 1.0 1 1

Limit (cost=0.03..0.04 rows=1 width=4) (actual time=0.093..0.093 rows=1 loops=1)

6. 0.092 0.092 ↑ 5,910.0 1 1

Index Only Scan using tb_exchange_calendar_idx1 on tb_exchange_calendar (cost=0.03..41.85 rows=5,910 width=4) (actual time=0.092..0.092 rows=1 loops=1)

  • Index Cond: ((id_exchange = 1) AND (in_processed_tb_stock_initial_update = 'S'::bpchar))
  • Heap Fetches: 1
7. 1.049 50.715 ↑ 37.0 248 1

Merge Join (cost=351.88..4,993.54 rows=9,180 width=90) (actual time=7.223..50.715 rows=248 loops=1)

  • Merge Cond: (tb_company.id_company = tb_company_action.id_company)
8. 42.416 42.416 ↑ 1.0 12,763 1

Index Scan using tb_company_pk on tb_company (cost=0.03..4,757.72 rows=13,129 width=80) (actual time=0.011..42.416 rows=12,763 loops=1)

9. 0.140 7.250 ↑ 37.0 248 1

Sort (cost=351.85..354.14 rows=9,180 width=18) (actual time=7.206..7.250 rows=248 loops=1)

  • Sort Key: tb_company_action.id_company
  • Sort Method: quicksort Memory: 44kB
10. 7.110 7.110 ↑ 37.0 248 1

Seq Scan on tb_company_action (cost=0.00..291.43 rows=9,180 width=18) (actual time=3.446..7.110 rows=248 loops=1)

  • Filter: (dt_limit >= $0)
  • Rows Removed by Filter: 24,077
11. 0.005 0.019 ↑ 1.0 17 1

Hash (cost=1.02..1.02 rows=17 width=62) (actual time=0.018..0.019 rows=17 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
12. 0.014 0.014 ↑ 1.0 17 1

Seq Scan on tb_company_action_type (cost=0.00..1.02 rows=17 width=62) (actual time=0.006..0.014 rows=17 loops=1)

13. 0.077 2,262.835 ↓ 161.5 323 1

Subquery Scan on *SELECT* 2 (cost=1,000.15..17,302.63 rows=2 width=140) (actual time=17.778..2,262.835 rows=323 loops=1)

14. 0.000 2,262.758 ↓ 161.5 323 1

Merge Join (cost=1,000.15..17,302.63 rows=2 width=140) (actual time=17.776..2,262.758 rows=323 loops=1)

  • Merge Cond: (tb_stock.id_company = tb_company_1.id_company)
15.          

Initplan (for Merge Join)

16. 0.001 0.025 ↑ 1.0 1 1

Limit (cost=0.03..0.04 rows=1 width=4) (actual time=0.025..0.025 rows=1 loops=1)

17. 0.024 0.024 ↑ 5,910.0 1 1

Index Only Scan using tb_exchange_calendar_idx1 on tb_exchange_calendar tb_exchange_calendar_1 (cost=0.03..41.85 rows=5,910 width=4) (actual time=0.023..0.024 rows=1 loops=1)

  • Index Cond: ((id_exchange = 1) AND (in_processed_tb_stock_initial_update = 'S'::bpchar))
  • Heap Fetches: 1
18. 80.759 2,302.999 ↓ 161.5 323 1

Gather Merge (cost=1,000.09..24,083.07 rows=2 width=33) (actual time=17.704..2,302.999 rows=323 loops=1)

  • Workers Planned: 2
  • Params Evaluated: $1
  • Workers Launched: 2
19. 0.312 2,222.240 ↓ 108.0 108 3 / 3

Nested Loop (cost=0.08..23,082.85 rows=1 width=33) (actual time=6.488..2,222.240 rows=108 loops=3)

20. 2,145.048 2,145.048 ↓ 1.1 1,260 3 / 3

Parallel Index Scan using tb_stock_crypto_idx08 on tb_stock (cost=0.04..10,309.74 rows=1,169 width=14) (actual time=2.462..2,145.048 rows=1,260 loops=3)

  • Index Cond: (cd_segment = '01'::bpchar)
  • Filter: ((tp_specification)::text <> 'DRN'::text)
  • Rows Removed by Filter: 236
21. 76.880 76.880 ↓ 0.0 0 3,781 / 3

Index Scan using tb_corporate_action_idx1 on tb_corporate_action (cost=0.04..10.93 rows=1 width=29) (actual time=0.061..0.061 rows=0 loops=3,781)

  • Index Cond: ((cd_codneg)::text = (tb_stock.cd_stock)::text)
  • Filter: ((dt_datdiv >= $1) AND (dt_datdiv < 30000000))
  • Rows Removed by Filter: 12
22. 11.540 11.540 ↑ 1.0 12,962 1

Index Scan using tb_company_pk on tb_company tb_company_1 (cost=0.03..4,757.72 rows=13,129 width=54) (actual time=0.020..11.540 rows=12,962 loops=1)

Planning time : 4.220 ms
Execution time : 2,368.189 ms