explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Pq6Q

Settings
# exclusive inclusive rows x rows loops node
1. 190.878 7,984.954 ↓ 2.0 78,551 1

Hash Anti Join (cost=3,192,192.88..3,672,564.26 rows=40,079 width=58) (actual time=7,764.452..7,984.954 rows=78,551 loops=1)

  • Hash Cond: (c.id = a.id)
2.          

CTE activity_theater_chain_press

3. 0.706 7,736.741 ↑ 6,964.2 2,302 1

Unique (cost=2,488,304.88..2,608,541.88 rows=16,031,600 width=40) (actual time=7,735.837..7,736.741 rows=2,302 loops=1)

4. 1.224 7,736.035 ↑ 6,964.2 2,302 1

Sort (cost=2,488,304.88..2,528,383.88 rows=16,031,600 width=40) (actual time=7,735.836..7,736.035 rows=2,302 loops=1)

  • Sort Key: company.id, (unnest((get_filtered_tags(company.tags, 'Company.Activity.TheaterChain'::lquery))::ltree[]))
  • Sort Method: quicksort Memory: 420kB
5. 0.296 7,734.811 ↑ 6,964.2 2,302 1

Append (cost=0.00..313,013.69 rows=16,031,600 width=40) (actual time=7.837..7,734.811 rows=2,302 loops=1)

6. 3,815.933 3,896.501 ↑ 4,268.3 1,878 1

ProjectSet (cost=0.00..76,348.85 rows=8,015,800 width=40) (actual time=7.837..3,896.501 rows=1,878 loops=1)

7. 10.867 80.568 ↓ 1.0 80,853 1

Result (cost=0.00..15,629.16 rows=80,158 width=89) (actual time=0.010..80.568 rows=80,853 loops=1)

8. 7.498 69.701 ↓ 1.0 80,853 1

Append (cost=0.00..14,827.58 rows=80,158 width=89) (actual time=0.010..69.701 rows=80,853 loops=1)

9. 18.017 18.017 ↓ 1.0 39,359 1

Seq Scan on company (cost=0.00..2,344.64 rows=38,664 width=84) (actual time=0.009..18.017 rows=39,359 loops=1)

10. 44.186 44.186 ↑ 1.0 41,494 1

Seq Scan on theater (cost=0.00..12,482.94 rows=41,494 width=94) (actual time=0.010..44.186 rows=41,494 loops=1)

11. 3,751.120 3,838.014 ↑ 18,905.2 424 1

ProjectSet (cost=0.00..76,348.85 rows=8,015,800 width=40) (actual time=7.874..3,838.014 rows=424 loops=1)

12. 11.400 86.894 ↓ 1.0 80,853 1

Result (cost=0.00..15,629.16 rows=80,158 width=89) (actual time=0.007..86.894 rows=80,853 loops=1)

13. 8.584 75.494 ↓ 1.0 80,853 1

Append (cost=0.00..14,827.58 rows=80,158 width=89) (actual time=0.007..75.494 rows=80,853 loops=1)

14. 18.518 18.518 ↓ 1.0 39,359 1

Seq Scan on company company_1 (cost=0.00..2,344.64 rows=38,664 width=84) (actual time=0.006..18.518 rows=39,359 loops=1)

15. 48.392 48.392 ↑ 1.0 41,494 1

Seq Scan on theater theater_1 (cost=0.00..12,482.94 rows=41,494 width=94) (actual time=0.008..48.392 rows=41,494 loops=1)

16. 4.411 56.340 ↓ 1.0 80,853 1

Append (cost=0.00..14,827.58 rows=80,158 width=58) (actual time=0.012..56.340 rows=80,853 loops=1)

17. 11.767 11.767 ↓ 1.0 39,359 1

Seq Scan on company c (cost=0.00..2,344.64 rows=38,664 width=55) (actual time=0.012..11.767 rows=39,359 loops=1)

18. 40.162 40.162 ↑ 1.0 41,494 1

Seq Scan on theater c_1 (cost=0.00..12,482.94 rows=41,494 width=60) (actual time=0.007..40.162 rows=41,494 loops=1)

19. 0.532 7,737.736 ↑ 6,964.2 2,302 1

Hash (cost=320,632.00..320,632.00 rows=16,031,600 width=8) (actual time=7,737.736..7,737.736 rows=2,302 loops=1)

  • Buckets: 4194304 Batches: 8 Memory Usage: 32780kB
20. 7,737.204 7,737.204 ↑ 6,964.2 2,302 1

CTE Scan on activity_theater_chain_press a (cost=0.00..320,632.00 rows=16,031,600 width=8) (actual time=7,735.840..7,737.204 rows=2,302 loops=1)

Planning time : 1.061 ms
Execution time : 7,989.328 ms