explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QUM7

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.021 16,832.208 ↑ 1.0 25 1

Limit (cost=81,139.89..178,218.09 rows=25 width=1,709) (actual time=4,893.653..16,832.208 rows=25 loops=1)

2. 0.620 16,832.187 ↑ 1,042,921.9 25 1

Nested Loop Left Join (cost=81,139.89..101,245,060,728.07 rows=26,073,048 width=1,709) (actual time=4,893.652..16,832.187 rows=25 loops=1)

3. 6,045.748 16,831.567 ↑ 521,461.0 25 1

Nested Loop Left Join (cost=81,139.18..101,128,890,138.23 rows=13,036,524 width=1,670) (actual time=4,893.628..16,831.567 rows=25 loops=1)

4. 0.279 10,785.819 ↑ 260,730.5 25 1

Nested Loop Left Join (cost=66,353.83..4,745,338,014.14 rows=6,518,262 width=1,638) (actual time=4,638.897..10,785.819 rows=25 loops=1)

5. 2.550 10,785.540 ↑ 260,730.5 25 1

Nested Loop Left Join (cost=66,353.40..4,735,055,455.83 rows=6,518,262 width=1,630) (actual time=4,638.885..10,785.540 rows=25 loops=1)

6. 0.092 10,782.990 ↑ 130,365.2 25 1

Nested Loop Left Join (cost=66,349.62..4,708,827,237.92 rows=3,259,131 width=1,598) (actual time=4,638.791..10,782.990 rows=25 loops=1)

7. 0.274 10,782.898 ↑ 130,365.2 25 1

Nested Loop Left Join (cost=66,349.19..4,707,079,208.33 rows=3,259,131 width=1,580) (actual time=4,638.787..10,782.898 rows=25 loops=1)

8. 0.595 10,782.624 ↑ 130,365.2 25 1

Nested Loop Left Join (cost=66,348.64..4,679,760,713.32 rows=3,259,131 width=1,564) (actual time=4,638.777..10,782.624 rows=25 loops=1)

9. 0.092 10,782.029 ↑ 130,365.2 25 1

Nested Loop Left Join (cost=66,342.35..4,659,169,899.34 rows=3,259,131 width=1,532) (actual time=4,638.757..10,782.029 rows=25 loops=1)

10. 0.523 10,781.937 ↑ 130,365.2 25 1

Nested Loop Left Join (cost=66,342.21..4,658,631,865.43 rows=3,259,131 width=1,511) (actual time=4,638.753..10,781.937 rows=25 loops=1)

11. 2.546 10,781.414 ↑ 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=4,638.735..10,781.414 rows=25 loops=1)

  • Join Filter: (c.id = pc.contact_id)
  • Rows Removed by Join Filter: 7325
12. 2,996.557 10,778.868 ↑ 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=4,637.676..10,778.868 rows=25 loops=1)

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

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

14. 0.221 0.221 ↑ 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.221 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,657.422 7,781.725 ↑ 1.0 322,466 25

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

17. 99.805 4,124.303 ↑ 1.0 334,449 1

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

18. 4,024.498 4,024.498 ↑ 1.0 334,449 1

GroupAggregate (cost=66,239.34..77,109.46 rows=334,465 width=52) (actual time=2,551.660..4,024.498 rows=334,449 loops=1)