explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tJqt

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 8.712 ↑ 1.0 10 1

Limit (cost=10.14..46,358.99 rows=10 width=35) (actual time=2.547..8.712 rows=10 loops=1)

2. 3.849 8.710 ↑ 52.2 10 1

Nested Loop (cost=10.14..2,419,420.32 rows=522 width=35) (actual time=2.546..8.710 rows=10 loops=1)

  • Join Filter: (alignments.orgunitid = orgunits.orgunitid)
  • Rows Removed by Join Filter: 53361
3. 0.038 0.324 ↑ 638.4 349 1

Nested Loop (cost=0.99..2,379,251.46 rows=222,787 width=43) (actual time=0.050..0.324 rows=349 loops=1)

4. 0.126 0.126 ↑ 1,907.7 16 1

Index Scan using customers_customername_idx on customers (cost=0.43..718,476.54 rows=30,523 width=27) (actual time=0.021..0.126 rows=16 loops=1)

  • Filter: ((customername ~~ '%PHARMACY%'::text) AND (customername !~~ 'PHARMACY%'::text) AND (customertypeid = 1))
  • Rows Removed by Filter: 97
5. 0.160 0.160 ↑ 7.8 22 16

Index Scan using alignments_customerid_idx on alignments (cost=0.56..52.70 rows=171 width=24) (actual time=0.005..0.010 rows=22 loops=16)

  • Index Cond: (customerid = customers.customerid)
6. 2.275 4.537 ↓ 12.8 153 349

Materialize (cost=9.14..67.23 rows=12 width=8) (actual time=0.003..0.013 rows=153 loops=349)

7. 0.359 2.262 ↓ 12.8 153 1

Hash Join (cost=9.14..67.17 rows=12 width=8) (actual time=0.983..2.262 rows=153 loops=1)

  • Hash Cond: (orgunits.orgunitlevelid = ol.orgunitlevelid)
8. 0.424 1.893 ↓ 8.9 5,013 1

Nested Loop (cost=0.85..56.63 rows=566 width=16) (actual time=0.020..1.893 rows=5,013 loops=1)

9. 0.001 0.008 ↑ 1.0 1 1

Nested Loop (cost=0.56..16.61 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=1)

10. 0.005 0.005 ↑ 1.0 1 1

Index Scan using userorgunitmapping_userid_idx on userorgunitmapping uom (cost=0.28..8.30 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (userid = 5910)
11. 0.002 0.002 ↑ 1.0 1 1

Index Scan using pk_orgunits_orgunitid on orgunits orgunits_1 (cost=0.28..8.30 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (orgunitid = uom.orgunitid)
12. 1.461 1.461 ↓ 8.9 5,013 1

Index Scan using orgunits_treeright_idx on orgunits (cost=0.28..34.36 rows=566 width=24) (actual time=0.011..1.461 rows=5,013 loops=1)

  • Index Cond: (treeright <= orgunits_1.treeright)
  • Filter: (treeleft >= orgunits_1.treeleft)
13. 0.006 0.010 ↑ 1.0 5 1

Hash (cost=8.23..8.23 rows=5 width=8) (actual time=0.010..0.010 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.004 0.004 ↑ 1.0 5 1

Index Scan using orgunitlevel_salesforceid_idx on orgunitlevel ol (cost=0.14..8.23 rows=5 width=8) (actual time=0.003..0.004 rows=5 loops=1)

  • Index Cond: (salesforceid = 313)
Planning time : 1.344 ms