explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CDU1

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 7,898.671 ↓ 2.0 10 1

Limit (cost=47,419.05..47,419.07 rows=5 width=23) (actual time=7,898.669..7,898.671 rows=10 loops=1)

2. 0.526 7,898.669 ↓ 2.0 10 1

Sort (cost=47,419.05..47,419.07 rows=5 width=23) (actual time=7,898.668..7,898.669 rows=10 loops=1)

  • Sort Key: customers.lastname
  • Sort Method: top-N heapsort Memory: 25kB
3. 0.000 7,898.143 ↓ 35.0 175 1

Nested Loop (cost=1.14..47,419.00 rows=5 width=23) (actual time=30.309..7,898.143 rows=175 loops=1)

4. 189.120 1,798.256 ↓ 26.3 2,084,902 1

Nested Loop (cost=0.71..9,216.20 rows=79,181 width=16) (actual time=3.267..1,798.256 rows=2,084,902 loops=1)

5. 3.861 7.226 ↓ 12.8 153 1

Nested Loop (cost=0.14..655.21 rows=12 width=8) (actual time=3.253..7.226 rows=153 loops=1)

  • Join Filter: (orgunits.orgunitlevelid = ol.orgunitlevelid)
  • Rows Removed by Join Filter: 24912
6. 0.839 3.365 ↓ 8.9 5,013 1

Nested Loop (cost=0.00..604.51 rows=566 width=16) (actual time=1.152..3.365 rows=5,013 loops=1)

  • Join Filter: ((orgunits.treeleft >= orgunits_1.treeleft) AND (orgunits.treeright <= orgunits_1.treeright))
  • Rows Removed by Join Filter: 82
7. 0.326 1.503 ↑ 1.0 1 1

Nested Loop (cost=0.00..343.14 rows=1 width=8) (actual time=1.147..1.503 rows=1 loops=1)

  • Join Filter: (orgunits_1.orgunitid = uom.orgunitid)
  • Rows Removed by Join Filter: 5094
8. 0.348 0.348 ↑ 1.0 1 1

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

  • Filter: (userid = 5910)
  • Rows Removed by Filter: 4999
9. 0.829 0.829 ↑ 1.0 5,095 1

Seq Scan on orgunits orgunits_1 (cost=0.00..184.95 rows=5,095 width=16) (actual time=0.004..0.829 rows=5,095 loops=1)

10. 1.023 1.023 ↑ 1.0 5,095 1

Seq Scan on orgunits (cost=0.00..184.95 rows=5,095 width=24) (actual time=0.002..1.023 rows=5,095 loops=1)

11. 0.000 0.000 ↑ 1.0 5 5,013

Materialize (cost=0.14..8.26 rows=5 width=8) (actual time=0.000..0.000 rows=5 loops=5,013)

12. 0.007 0.007 ↑ 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.005..0.007 rows=5 loops=1)

  • Index Cond: (salesforceid = 313)
13. 1,601.910 1,601.910 ↓ 1.0 13,627 153

Index Scan using alignments_orgunitid_idx on alignments (cost=0.56..580.22 rows=13,320 width=24) (actual time=0.007..10.470 rows=13,627 loops=153)

  • Index Cond: (orgunitid = orgunits.orgunitid)
14. 6,254.706 6,254.706 ↓ 0.0 0 2,084,902

Index Scan using pk_customers_customerid on customers (cost=0.43..0.47 rows=1 width=15) (actual time=0.003..0.003 rows=0 loops=2,084,902)

  • Index Cond: (customerid = alignments.customerid)
  • Filter: ((lastname ~~ 'NIG%'::text) AND (lastname <> 'NIG'::text) AND (customertypeid = 1))
  • Rows Removed by Filter: 1
Planning time : 1.397 ms