explain.depesz.com

PostgreSQL's explain analyze made readable

Result: al8x : Optimization for: Optimization for: plan #yBTq; plan #CdSu

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.020 30,041.832 ↑ 1.0 25 1

Limit (cost=187,943.92..324,957.06 rows=25 width=1,709) (actual time=9,250.402..30,041.832 rows=25 loops=1)

2. 0.607 30,041.812 ↑ 521,461.8 25 1

Nested Loop Left Join (cost=187,943.92..71,447,303,253.36 rows=13,036,544 width=1,709) (actual time=9,250.401..30,041.812 rows=25 loops=1)

3. 6,101.667 30,041.205 ↑ 260,730.9 25 1

Nested Loop Left Join (cost=187,943.20..71,389,217,869.33 rows=6,518,272 width=1,670) (actual time=9,250.377..30,041.205 rows=25 loops=1)

4. 0.376 23,939.538 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=173,157.85..23,197,367,873.81 rows=3,259,136 width=1,638) (actual time=8,971.927..23,939.538 rows=25 loops=1)

5. 0.179 23,939.162 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=173,157.43..23,192,226,586.77 rows=3,259,136 width=1,630) (actual time=8,971.912..23,939.162 rows=25 loops=1)

6. 13,951.794 23,938.983 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=173,157.00..23,190,478,554.49 rows=3,259,136 width=1,612) (actual time=8,971.905..23,938.983 rows=25 loops=1)

  • Join Filter: (c.id = ic.contact_id)
  • Rows Removed by Join Filter: 12403812
7. 0.268 9,987.189 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=66,349.19..4,707,079,282.65 rows=3,259,136 width=1,580) (actual time=3,770.151..9,987.189 rows=25 loops=1)

8. 0.560 9,986.921 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=66,348.64..4,679,760,745.74 rows=3,259,136 width=1,564) (actual time=3,770.140..9,986.921 rows=25 loops=1)

9. 0.095 9,986.361 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=66,342.35..4,659,169,900.16 rows=3,259,136 width=1,532) (actual time=3,770.120..9,986.361 rows=25 loops=1)

10. 0.508 9,986.266 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=66,342.21..4,658,631,865.43 rows=3,259,136 width=1,511) (actual time=3,770.115..9,986.266 rows=25 loops=1)

11. 2.534 9,985.758 ↑ 22,477.2 25 1

Nested Loop Left Join (cost=66,341.78..4,658,346,316.68 rows=561,929 width=1,442) (actual time=3,770.097..9,985.758 rows=25 loops=1)

  • Join Filter: (c.id = pc.contact_id)
  • Rows Removed by Join Filter: 7325
12. 2,880.643 9,983.224 ↑ 22,477.2 25 1

Nested Loop Left Join (cost=66,240.19..4,655,404,514.13 rows=561,929 width=1,434) (actual time=3,769.063..9,983.224 rows=25 loops=1)

  • Join Filter: (c.id = clc.contact_id)
  • Rows Removed by Join Filter: 8061647
13. 0.130 0.581 ↑ 22,477.2 25 1

Nested Loop (cost=0.84..325,720.01 rows=561,929 width=1,386) (actual time=0.135..0.581 rows=25 loops=1)

14. 0.226 0.226 ↑ 22,482.4 25 1

Index Scan using contact_insert_timestamp_desc__idx on contact c (cost=0.42..66,147.43 rows=562,059 width=1,347) (actual time=0.122..0.226 rows=25 loops=1)

  • Filter: ((deleted_timestamp IS NULL) AND ((board >= 1) OR (board IS NULL)))
  • Rows Removed by Filter: 188
15. 0.225 0.225 ↑ 1.0 1 25

Index Scan using company__pkey on company co (cost=0.42..0.46 rows=1 width=43) (actual time=0.009..0.009 rows=1 loops=25)

  • Index Cond: (id = c.company_id)
  • Filter: (deleted_timestamp IS NULL)
16. 3,699.941 7,102.000 ↑ 1.0 322,466 25

Materialize (cost=66,239.34..85,393.43 rows=334,465 width=52) (actual time=75.748..284.080 rows=322,466 loops=25)

17. 3,402.059 3,402.059 ↑ 1.0 334,449 1

Subquery Scan on clc (cost=66,239.34..80,454.11 rows=334,465 width=52) (actual time=1,893.413..3,402.059 rows=334,449 loops=1)