explain.depesz.com

PostgreSQL's explain analyze made readable

Result: htGv

Settings
# exclusive inclusive rows x rows loops node
1. 0.045 5,551.742 ↑ 1.0 1 1

Aggregate (cost=848,008.58..848,008.59 rows=1 width=8) (actual time=5,551.741..5,551.742 rows=1 loops=1)

2. 1,682.091 5,551.697 ↑ 9.9 8 1

Hash Right Join (cost=558,994.95..848,008.39 rows=79 width=37) (actual time=4,574.592..5,551.697 rows=8 loops=1)

  • Hash Cond: ((document_recipients.document_id)::text = (documents.id)::text)
  • Filter: ((access_to_doc.role_id = '6e578b99-7e5b-4e76-a375-9e8d126db5f7'::uuid) OR (document_recipients.emails @> '{Viktoria.Krutikova@lifecell.com.ua}'::character varying[]))
  • Rows Removed by Filter: 1467859
3. 579.590 579.590 ↓ 1.0 4,027,612 1

Seq Scan on document_recipients (cost=0.00..133,562.55 rows=3,977,855 width=84) (actual time=0.027..579.590 rows=4,027,612 loops=1)

4. 224.564 3,290.016 ↓ 1.0 1,037,901 1

Hash (cost=530,985.80..530,985.80 rows=1,031,692 width=90) (actual time=3,290.015..3,290.016 rows=1,037,901 loops=1)

  • Buckets: 1048576 Batches: 2 Memory Usage: 70102kB
5. 960.141 3,065.452 ↓ 1.0 1,037,901 1

Hash Join (cost=361,559.01..530,985.80 rows=1,031,692 width=90) (actual time=1,861.773..3,065.452 rows=1,037,901 loops=1)

  • Hash Cond: ((access_to_doc.document_id)::text = (documents.id)::text)
6. 245.832 245.832 ↑ 1.0 1,052,443 1

Index Only Scan using uix_access_to_doc_access_edrpou_role_id_document_id on access_to_doc (cost=0.56..102,345.72 rows=1,053,428 width=53) (actual time=0.030..245.832 rows=1,052,443 loops=1)

  • Index Cond: (access_edrpou = '22859846'::text)
  • Heap Fetches: 72156
7. 587.348 1,859.479 ↓ 1.0 3,626,655 1

Hash (cost=288,011.21..288,011.21 rows=3,620,739 width=37) (actual time=1,859.479..1,859.479 rows=3,626,655 loops=1)

  • Buckets: 2097152 Batches: 4 Memory Usage: 77387kB
8. 1,272.131 1,272.131 ↓ 1.0 3,626,655 1

Seq Scan on documents (cost=0.00..288,011.21 rows=3,620,739 width=37) (actual time=0.026..1,272.131 rows=3,626,655 loops=1)

  • Filter: (is_internal IS FALSE)
  • Rows Removed by Filter: 70452
Planning time : 1.085 ms
Execution time : 5,555.518 ms