explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jTsI

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 8,916.037 ↓ 2.0 10 1

Limit (cost=47,221.10..47,221.11 rows=5 width=23) (actual time=8,916.035..8,916.037 rows=10 loops=1)

2. 0.438 8,916.035 ↓ 2.0 10 1

Sort (cost=47,221.10..47,221.11 rows=5 width=23) (actual time=8,916.034..8,916.035 rows=10 loops=1)

  • Sort Key: customers.lastname
  • Sort Method: top-N heapsort Memory: 25kB
3. 855.545 8,915.597 ↓ 35.0 175 1

Nested Loop (cost=1.14..47,221.04 rows=5 width=23) (actual time=33.919..8,915.597 rows=175 loops=1)

4. 194.667 1,805.346 ↓ 26.3 2,084,902 1

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

5. 3.804 7.086 ↓ 12.8 153 1

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

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

Nested Loop (cost=0.00..604.51 rows=566 width=16) (actual time=1.118..3.282 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.343 1.462 ↑ 1.0 1 1

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

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

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

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

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

10. 0.990 0.990 ↑ 1.0 5,095 1

Seq Scan on orgunits (cost=0.00..184.95 rows=5,095 width=24) (actual time=0.001..0.990 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,603.593 1,603.593 ↓ 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.481 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 (customertypeid = 1))
  • Rows Removed by Filter: 1
Planning time : 1.394 ms