explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.022 15,873.580 ↑ 1.0 25 1

Limit (cost=81,139.89..178,218.09 rows=25 width=1,709) (actual time=4,090.063..15,873.580 rows=25 loops=1)

2. 0.602 15,873.558 ↑ 1,042,922.9 25 1

Nested Loop Left Join (cost=81,139.89..101,245,149,634.99 rows=26,073,072 width=1,709) (actual time=4,090.061..15,873.558 rows=25 loops=1)

3. 5,968.420 15,872.956 ↑ 521,461.4 25 1

Nested Loop Left Join (cost=81,139.18..101,128,978,938.21 rows=13,036,536 width=1,670) (actual time=4,090.035..15,872.956 rows=25 loops=1)

4. 0.285 9,904.536 ↑ 260,730.7 25 1

Nested Loop Left Join (cost=66,353.83..4,745,338,093.95 rows=6,518,268 width=1,638) (actual time=3,842.777..9,904.536 rows=25 loops=1)

5. 2.453 9,904.251 ↑ 260,730.7 25 1

Nested Loop Left Join (cost=66,353.40..4,735,055,526.18 rows=6,518,268 width=1,630) (actual time=3,842.766..9,904.251 rows=25 loops=1)

6. 0.092 9,901.798 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=66,349.62..4,708,827,284.12 rows=3,259,134 width=1,598) (actual time=3,842.675..9,901.798 rows=25 loops=1)

7. 0.274 9,901.706 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=66,349.19..4,707,079,252.92 rows=3,259,134 width=1,580) (actual time=3,842.671..9,901.706 rows=25 loops=1)

8. 0.570 9,901.432 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=66,348.64..4,679,760,732.77 rows=3,259,134 width=1,564) (actual time=3,842.661..9,901.432 rows=25 loops=1)

9. 0.091 9,900.862 ↑ 130,365.4 25 1

Nested Loop Left Join (cost=66,342.35..4,659,169,899.83 rows=3,259,134 width=1,532) (actual time=3,842.641..9,900.862 rows=25 loops=1)

10. 0.505 9,900.771 ↑ 130,365.4 25 1

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

11. 2.544 9,900.266 ↑ 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,842.619..9,900.266 rows=25 loops=1)

  • Join Filter: (c.id = pc.contact_id)
  • Rows Removed by Join Filter: 7325
12. 2,669.032 9,897.722 ↑ 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,841.582..9,897.722 rows=25 loops=1)

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

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

14. 0.220 0.220 ↑ 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.120..0.220 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,794.431 7,228.100 ↑ 1.0 322,466 25

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

17. 127.265 3,433.669 ↑ 1.0 334,449 1

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

18. 3,306.404 3,306.404 ↑ 1.0 334,449 1

GroupAggregate (cost=66,239.34..77,109.46 rows=334,465 width=52) (actual time=2,039.433..3,306.404 rows=334,449 loops=1)