explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sWUK

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Subquery Scan on foo (cost=10,289,533.09..3,883,348,499.89 rows=1,754 width=101) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=10,289,533.09..10,289,537.48 rows=1,754 width=105) (actual rows= loops=)

  • Sort Key: glled."trade-day", glled."gl-line
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..10,289,438.58 rows=1,754 width=105) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Seq Scan on "gen-ledg" gl (cost=0.00..193.92 rows=28 width=43) (actual rows= loops=)

  • Filter: ((upper((glcode)::text) <= 'ZZZZ'::text) AND (upper((glcode)::text) >= '0'::text))
5. 0.000 0.000 ↓ 0.0

Index Scan using "gl-led_idx2" on "gl-led" glled (cost=0.00..367,469.10 rows=392 width=74) (actual rows= loops=)

  • Index Cond: ((glcode)::text = (gl.glcode)::text)
  • Filter: ("gl-line" = (SubPlan 6))
6.          

SubPlan (for Index Scan)

7. 0.000 0.000 ↓ 0.0

Result (cost=1.78..1.79 rows=1 width=0) (actual rows= loops=)

8.          

Initplan (for Result)

9. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..1.78 rows=1 width=4) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Index Only Scan Backward using "gl-led_pkey" on "gl-led" g2 (cost=0.00..139,811.28 rows=78,337 width=4) (actual rows= loops=)

  • Index Cond: ((cncycode = (glled.cncycode)::text) AND (glcode = (glled.glcode)::text) AND ("gl-line" IS NOT NULL))
11.          

SubPlan (for Subquery Scan)

12. 0.000 0.000 ↓ 0.0

Limit (cost=2,208,117.73..2,208,117.73 rows=1 width=15) (actual rows= loops=)

13.          

Initplan (for Limit)

14. 0.000 0.000 ↓ 0.0

Index Scan using "eod_eod-date_trading_settlemen" on eod (cost=0.00..8.27 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ("eod-date" = '2020-08-18'::date)
15. 0.000 0.000 ↓ 0.0

Sort (cost=2,208,109.46..2,208,398.98 rows=115,808 width=15) (actual rows= loops=)

  • Sort Key: glled."trade-day", glled."gl-line
16. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on "gl-led" glled (cost=427,780.22..2,207,530.42 rows=115,808 width=15) (actual rows= loops=)

  • Recheck Cond: ("trade-day" < $0)
  • Filter: (((cncycode)::text = 'AUD'::text) AND (upper((glcode)::text) = upper((foo.glcode)::text)))
17. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "gl-led_trade-day_led-val" (cost=0.00..427,751.27 rows=23,161,520 width=0) (actual rows= loops=)

  • Index Cond: ("trade-day" < $0)
18. 0.000 0.000 ↓ 0.0

Limit (cost=8.27..11.65 rows=1 width=15) (actual rows= loops=)

19.          

Initplan (for Limit)

20. 0.000 0.000 ↓ 0.0

Index Scan using "eod_eod-date_trading_settlemen" on eod (cost=0.00..8.27 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ("eod-date" = '2020-08-21'::date)
21. 0.000 0.000 ↓ 0.0

Index Scan using "gl-led_BalanceOnTradeDay" on "gl-led" glled (cost=0.00..88,370.85 rows=26,112 width=15) (actual rows= loops=)

  • Index Cond: (((glcode)::text = (foo.glcode)::text) AND ((cncycode)::text = 'AUD'::text) AND ("trade-day" <= $2))