explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qCfx

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 2.623 ↑ 1.0 10 1

Limit (cost=1.84..33.59 rows=10 width=33) (actual time=2.576..2.623 rows=10 loops=1)

2. 0.008 2.619 ↑ 223.0 10 1

Nested Loop (cost=1.84..7,082.61 rows=2,230 width=33) (actual time=2.575..2.619 rows=10 loops=1)

3. 0.004 2.581 ↑ 493.0 10 1

Nested Loop (cost=1.41..4,067.77 rows=4,930 width=33) (actual time=2.568..2.581 rows=10 loops=1)

4. 0.002 2.532 ↑ 12.0 1 1

Nested Loop (cost=0.85..291.40 rows=12 width=33) (actual time=2.532..2.532 rows=1 loops=1)

  • Join Filter: (orgunits.orgunitlevelid = orgunitlevel.orgunitlevelid)
  • Rows Removed by Join Filter: 40
5. 0.001 2.513 ↑ 12.0 1 1

Nested Loop (cost=0.85..237.78 rows=12 width=32) (actual time=2.513..2.513 rows=1 loops=1)

6. 1.550 2.506 ↑ 12.0 1 1

Nested Loop (cost=0.56..233.23 rows=12 width=16) (actual time=2.506..2.506 rows=1 loops=1)

  • Join Filter: (orgunits_1.orgunitlevelid = ol.orgunitlevelid)
  • Rows Removed by Join Filter: 10760
7. 0.179 0.956 ↓ 3.8 2,153 1

Nested Loop (cost=0.56..179.81 rows=566 width=16) (actual time=0.050..0.956 rows=2,153 loops=1)

8. 0.003 0.018 ↑ 1.0 1 1

Nested Loop (cost=0.28..139.84 rows=1 width=8) (actual time=0.018..0.018 rows=1 loops=1)

9. 0.008 0.008 ↑ 1.0 1 1

Seq Scan on userorgunitmapping uom (cost=0.00..131.53 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=1)

  • Filter: (userid = 8975)
10. 0.007 0.007 ↑ 1.0 1 1

Index Scan using orgunits_orgunitid_orgunitlevelid on orgunits orgunits_2 (cost=0.28..8.30 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (orgunitid = uom.orgunitid)
11. 0.759 0.759 ↓ 3.8 2,153 1

Index Scan using orgunits_treeright_idx on orgunits orgunits_1 (cost=0.28..34.31 rows=566 width=24) (actual time=0.032..0.759 rows=2,153 loops=1)

  • Index Cond: (treeright <= orgunits_2.treeright)
  • Filter: (treeleft >= orgunits_2.treeleft)
12. 0.000 0.000 ↑ 1.0 5 2,153

Materialize (cost=0.00..10.99 rows=5 width=16) (actual time=0.000..0.000 rows=5 loops=2,153)

13. 0.039 0.039 ↑ 1.0 5 1

Seq Scan on orgunitlevel ol (cost=0.00..10.96 rows=5 width=16) (actual time=0.011..0.039 rows=5 loops=1)

  • Filter: (salesforceid = 313)
  • Rows Removed by Filter: 232
14. 0.006 0.006 ↑ 1.0 1 1

Index Scan using pk_orgunits_orgunitid on orgunits (cost=0.28..0.37 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (orgunitid = orgunits_1.orgunitid)
15. 0.009 0.017 ↑ 5.8 41 1

Materialize (cost=0.00..11.56 rows=237 width=9) (actual time=0.003..0.017 rows=41 loops=1)

16. 0.008 0.008 ↑ 5.8 41 1

Seq Scan on orgunitlevel (cost=0.00..10.37 rows=237 width=9) (actual time=0.001..0.008 rows=41 loops=1)

17. 0.045 0.045 ↑ 82.9 10 1

Index Only Scan using alignments_salesforceid_orgunitid_customerid on alignments (cost=0.56..306.41 rows=829 width=24) (actual time=0.033..0.045 rows=10 loops=1)

  • Index Cond: ((salesforceid = 313) AND (orgunitid = orgunits_1.orgunitid))
  • Heap Fetches: 10
18. 0.030 0.030 ↑ 1.0 1 10

Index Scan using pk_customers_customerid on customers (cost=0.43..0.60 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=10)

  • Index Cond: (customerid = alignments.customerid)
  • Filter: (((NOT is_pdrp_enabled) OR (is_pdrp_enabled IS NULL)) AND (customertypeid = 1))