explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mwP0

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

Limit (cost=586,488.21..586,488.22 rows=5 width=490) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=586,488.21..586,488.22 rows=5 width=490) (actual rows= loops=)

  • Sort Key: rvbt.txid DESC, rvbt.bookingdate DESC
3. 0.000 0.000 ↓ 0.0

Merge Join (cost=584,362.01..586,488.15 rows=5 width=490) (actual rows= loops=)

  • Merge Cond: (rt.registertypeid = jtmr.registertypeid)
  • Join Filter: (rvbt.journaltypeid = jtmr.journaltypeid)
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=575,017.29..690,526.19 rows=272 width=494) (actual rows= loops=)

  • Join Filter: ((rvbt.registertypecode)::text = (rt.registertypecode)::text)
5. 0.000 0.000 ↓ 0.0

Index Scan using registertype_pkey on registertype rt (cost=0.14..3.90 rows=51 width=22) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Materialize (cost=575,017.15..690,314.88 rows=272 width=500) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=575,017.15..690,313.52 rows=272 width=500) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=575,016.57..606,440.73 rows=4,851 width=400) (actual rows= loops=)

  • Group Key: rvbt2.txid
9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=575,016.57..606,198.06 rows=4,854 width=672) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=575,016.15..600,089.89 rows=4,854 width=651) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=575,015.72..588,442.92 rows=4,854 width=281) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=575,015.15..575,844.65 rows=4,854 width=144) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=575,015.01..575,041.74 rows=4,854 width=146) (actual rows= loops=)

  • Merge Cond: (rvbt2.txid = rvbtt.txid)
14. 0.000 0.000 ↓ 0.0

Sort (cost=574,978.22..574,990.35 rows=4,854 width=18) (actual rows= loops=)

  • Sort Key: rvbt2.txid DESC
15. 0.000 0.000 ↓ 0.0

Index Scan using rvbt_accountid_bd on viasbasetransaction rvbt2 (cost=0.57..574,681.03 rows=4,854 width=18) (actual rows= loops=)

  • Index Cond: (virtualaccountid = 10,299,039)
  • Filter: (((registertypecode)::text = 'Balance'::text) AND ((journaltypecode)::text = ANY ('{CrossFlowPayout,VirtualAccountPayoutReturned,XASTransfer}'::text[])))
16. 0.000 0.000 ↓ 0.0

Sort (cost=36.79..38.02 rows=490 width=136) (actual rows= loops=)

  • Sort Key: rvbtt.txid DESC
17. 0.000 0.000 ↓ 0.0

Seq Scan on viasbalancetransfertransaction rvbtt (cost=0.00..14.90 rows=490 width=136) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Only Scan using journaltypemainregister_pkey on journaltypemainregister jtmr_1 (cost=0.14..0.16 rows=1 width=2) (actual rows= loops=)

  • Index Cond: (journaltypeid = rvbt2.journaltypeid)
19. 0.000 0.000 ↓ 0.0

Index Scan using viastransfertransaction_pkey on viastransfertransaction rvtt (cost=0.57..2.59 rows=1 width=145) (actual rows= loops=)

  • Index Cond: (txid = rvbt2.txid)
20. 0.000 0.000 ↓ 0.0

Index Scan using viaspayouttransaction_pkey on viaspayouttransaction rvpt (cost=0.43..2.39 rows=1 width=378) (actual rows= loops=)

  • Index Cond: (txid = rvbt2.txid)
21. 0.000 0.000 ↓ 0.0

Index Scan using viaschargebacktransaction_pkey on viaschargebacktransaction rvct (cost=0.42..1.25 rows=1 width=29) (actual rows= loops=)

  • Index Cond: (txid = rvbt2.txid)
22. 0.000 0.000 ↓ 0.0

Index Scan using rvbt_txid_bd on viasbasetransaction rvbt (cost=0.57..17.27 rows=1 width=116) (actual rows= loops=)

  • Index Cond: (txid = rvbt2.txid)
  • Filter: ((virtualaccountid = 10,299,039) AND ((max(rvbt2.bookingdate)) >= bookingdate))
23. 0.000 0.000 ↓ 0.0

Sort (cost=2.04..2.11 rows=30 width=4) (actual rows= loops=)

  • Sort Key: jtmr.registertypeid
24. 0.000 0.000 ↓ 0.0

Seq Scan on journaltypemainregister jtmr (cost=0.00..1.30 rows=30 width=4) (actual rows= loops=)