explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5zBX

Settings
# exclusive inclusive rows x rows loops node
1. 0.083 766.087 ↓ 64.0 64 1

Unique (cost=560.47..847.48 rows=1 width=44) (actual time=19.673..766.087 rows=64 loops=1)

2. 0.174 766.004 ↓ 64.0 64 1

Nested Loop (cost=560.47..847.47 rows=1 width=44) (actual time=19.673..766.004 rows=64 loops=1)

3. 0.177 76.422 ↓ 64.0 64 1

Nested Loop (cost=0.84..287.82 rows=1 width=12) (actual time=2.347..76.422 rows=64 loops=1)

4. 75.861 75.861 ↓ 64.0 64 1

Index Scan using vw_secmap_eid_idx on vw_secmap map (cost=0.42..283.37 rows=1 width=12) (actual time=2.326..75.861 rows=64 loops=1)

  • Index Cond: (eid = ANY ('{1000000779,1000000780,1000000829,1000000835,1000000838,1000000902,1000000978,1000001000,1000001025,1000001319,1000001330,1000001374,1000001405,1000001448,1000001477,1000001525,1000001534,1000001561,1000001562,1000001634,1000001644,1000001657,1000001663,1000001687,1000001721,1000001735,1000001749,1000001750,1000001757,1000001774,1000001824,1000001906,1000001910,1000001944,1000001977,1000001993,1000001994,1000002001,1000002007,1000002020,1000002042,1000002060,1000002081,1000002099,1000002117,1000002141,1000002171,1000002290,1000002299,1000002360,1000002373,1000002388,1000002427,1000002429,1000002459,1000002484,1000002494,1000002515,1000002526,1000002529,1000002533,1000002540,1000002665,1000002667}'::bigint[]))
5. 0.384 0.384 ↑ 1.0 1 64

Index Only Scan using all_equities_vw9_eid_only_idx on all_equities_vw9 q (cost=0.42..4.44 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=64)

  • Index Cond: (eid = map.eid)
  • Heap Fetches: 0
6. 0.128 689.408 ↑ 1.0 1 64

Limit (cost=559.63..559.63 rows=1 width=48) (actual time=10.772..10.772 rows=1 loops=64)

7. 0.384 689.280 ↑ 2.0 1 64

Sort (cost=559.63..559.63 rows=2 width=48) (actual time=10.770..10.770 rows=1 loops=64)

  • Sort Key: prim.date DESC
  • Sort Method: quicksort Memory: 25kB
8. 0.064 688.896 ↑ 2.0 1 64

Append (cost=1.42..559.62 rows=2 width=48) (actual time=7.418..10.764 rows=1 loops=64)

9. 0.064 474.752 ↑ 1.0 1 64

Subquery Scan on prim (cost=1.42..66.58 rows=1 width=48) (actual time=7.417..7.418 rows=1 loops=64)

10. 0.064 474.688 ↑ 1.0 1 64

Limit (cost=1.42..66.57 rows=1 width=56) (actual time=7.417..7.417 rows=1 loops=64)

11. 0.448 474.624 ↑ 472.0 1 64

Nested Loop (cost=1.42..30,751.12 rows=472 width=56) (actual time=7.416..7.416 rows=1 loops=64)

  • Join Filter: ((d.marketdate >= a.adjdate) AND ((d.marketdate <= a.endadjdate) OR (a.endadjdate IS NULL)))
12. 0.256 352.960 ↑ 652.0 1 64

Nested Loop (cost=0.99..30,700.07 rows=652 width=25) (actual time=5.515..5.515 rows=1 loops=64)

  • Join Filter: (d.exchintcode = x.exchintcode)
13. 225.472 225.472 ↑ 15,345.0 1 64

Index Scan Backward using ds2primqtprc_pkey on ds2primqtprc d (cost=0.57..30,225.13 rows=15,345 width=22) (actual time=3.523..3.523 rows=1 loops=64)

  • Index Cond: ((infocode = map.vencode) AND (marketdate >= '1900-01-01 00:00:00'::timestamp without time zone) AND (marketdate <= '2019-08-31 00:00:00'::timestamp without time zone))
  • Filter: ((close_ IS NOT NULL) AND (close_ <> '0'::double precision))
14. 0.128 127.232 ↑ 2.0 1 64

Materialize (cost=0.42..14.59 rows=2 width=11) (actual time=1.988..1.988 rows=1 loops=64)

15. 127.104 127.104 ↑ 2.0 1 64

Index Scan using ds2exchqtinfo_pkey on ds2exchqtinfo x (cost=0.42..14.58 rows=2 width=11) (actual time=1.986..1.986 rows=1 loops=64)

  • Index Cond: (infocode = map.vencode)
  • Filter: (isprimexchqt = 'Y'::bpchar)
  • Rows Removed by Filter: 1
16. 0.128 121.216 ↑ 3.0 1 64

Materialize (cost=0.42..8.56 rows=3 width=24) (actual time=1.894..1.894 rows=1 loops=64)

17. 121.088 121.088 ↑ 3.0 1 64

Index Scan using ds2adj_infocode_idx on ds2adj a (cost=0.42..8.54 rows=3 width=24) (actual time=1.892..1.892 rows=1 loops=64)

  • Index Cond: (infocode = map.vencode)
  • Filter: (adjtype = 2)
18. 0.064 214.080 ↓ 0.0 0 64

Subquery Scan on scd (cost=493.03..493.04 rows=1 width=48) (actual time=3.345..3.345 rows=0 loops=64)

19. 0.064 214.016 ↓ 0.0 0 64

Limit (cost=493.03..493.03 rows=1 width=56) (actual time=3.344..3.344 rows=0 loops=64)

20. 0.256 213.952 ↓ 0.0 0 64

Sort (cost=493.03..494.26 rows=492 width=56) (actual time=3.343..3.343 rows=0 loops=64)

  • Sort Key: d_1.marketdate DESC
  • Sort Method: quicksort Memory: 25kB
21. 0.280 213.696 ↓ 0.0 0 64

Nested Loop (cost=1.42..490.57 rows=492 width=56) (actual time=3.339..3.339 rows=0 loops=64)

22. 0.192 61.440 ↑ 1.5 4 64

Nested Loop (cost=0.85..23.21 rows=6 width=35) (actual time=0.012..0.960 rows=4 loops=64)

23. 57.344 57.344 ↑ 2.0 1 64

Index Scan using ds2exchqtinfo_pkey on ds2exchqtinfo x_1 (cost=0.42..14.58 rows=2 width=11) (actual time=0.006..0.896 rows=1 loops=64)

  • Index Cond: (infocode = map.vencode)
  • Filter: (isprimexchqt = 'Y'::bpchar)
  • Rows Removed by Filter: 5
24. 0.128 3.904 ↓ 1.3 4 64

Materialize (cost=0.42..8.56 rows=3 width=24) (actual time=0.005..0.061 rows=4 loops=64)

25. 3.776 3.776 ↓ 1.3 4 64

Index Scan using ds2adj_infocode_idx on ds2adj a_1 (cost=0.42..8.54 rows=3 width=24) (actual time=0.003..0.059 rows=4 loops=64)

  • Index Cond: (infocode = map.vencode)
  • Filter: (adjtype = 2)
  • Rows Removed by Filter: 3
26. 151.976 151.976 ↓ 0.0 0 242

Index Scan using ds2scdqtprc_pkey on ds2scdqtprc d_1 (cost=0.57..76.34 rows=12 width=22) (actual time=0.628..0.628 rows=0 loops=242)

  • Index Cond: ((infocode = map.vencode) AND (exchintcode = x_1.exchintcode) AND (marketdate >= a_1.adjdate) AND (marketdate >= '1900-01-01 00:00:00'::timestamp without time zone) AND (marketdate <= '2019-08-31 00:00:00'::timestamp without time zone))
  • Filter: ((close_ IS NOT NULL) AND (close_ <> '0'::double precision) AND ((marketdate <= a_1.endadjdate) OR (a_1.endadjdate IS NULL)))
Planning time : 13.277 ms
Execution time : 766.329 ms