explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0GeA

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=227.52..244.25 rows=1 width=1,069) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Unique (cost=226.96..227.05 rows=2 width=260) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=226.96..226.97 rows=2 width=260) (actual rows= loops=)

  • Sort Key: x39.published, x39.persistence_sequence_number, x39.persistence_id, x39.type_id, x39.created_by, x40.document_organisation_id, x39.valid_until, x39.modified_by, x39.version, x40.access_level, x39.modified_date, x39.archived, x40.do
4. 0.000 0.000 ↓ 0.0

Append (cost=1.40..226.95 rows=2 width=260) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.40..25.41 rows=1 width=259) (actual rows= loops=)

  • Join Filter: ((x40.document_id)::text = (x39.document_id)::text)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..16.90 rows=1 width=76) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Scan using document_permission on user_document_permission x40 (cost=0.43..8.45 rows=1 width=50) (actual rows= loops=)

  • Index Cond: (((document_organisation_id)::text = 'c-bozek-company-limited-ww'::text) AND ((target_user_id)::text = 'u-kamil-bozek-apb'::text))
  • Filter: (((access_level)::text <> 'NoPermissions'::text) AND (valid_until = '294276-01-01 00:00:00'::timestamp without time zone))
8. 0.000 0.000 ↓ 0.0

Index Scan using document_pkey on document x47 (cost=0.42..8.44 rows=1 width=26) (actual rows= loops=)

  • Index Cond: ((id)::text = (x40.document_id)::text)
  • Filter: (deleted_at IS NULL)
9. 0.000 0.000 ↓ 0.0

Index Scan using document_metadata_repo_seek_index on document_metadata x39 (cost=0.55..8.50 rows=1 width=209) (actual rows= loops=)

  • Index Cond: ((valid_until = '294276-01-01 00:00:00'::timestamp without time zone) AND (published = true) AND ((type_id)::text = 'pipeline'::text) AND ((organisation_id)::text = 'c-bozek-company-limited-ww'::text) AND ((docu
  • Filter: published
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5.39..201.52 rows=1 width=262) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.97..199.38 rows=1 width=262) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on organisation_document_permission x67 (cost=4.42..61.94 rows=16 width=53) (actual rows= loops=)

  • Recheck Cond: ((target_organisation_id)::text = 'c-bozek-company-limited-ww'::text)
  • Filter: (((access_level)::text <> 'NoPermissions'::text) AND (valid_until = '294276-01-01 00:00:00'::timestamp without time zone))
13. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on org_doc_permission_target_index (cost=0.00..4.41 rows=17 width=0) (actual rows= loops=)

  • Index Cond: ((target_organisation_id)::text = 'c-bozek-company-limited-ww'::text)
14. 0.000 0.000 ↓ 0.0

Index Scan using document_metadata_repo_seek_index on document_metadata x66 (cost=0.55..8.58 rows=1 width=209) (actual rows= loops=)

  • Index Cond: ((valid_until = '294276-01-01 00:00:00'::timestamp without time zone) AND (published = true) AND ((type_id)::text = 'pipeline'::text) AND ((organisation_id)::text = (x67.document_organisation_id)::text) AN
  • Filter: published
15. 0.000 0.000 ↓ 0.0

Index Scan using document_pkey on document x74 (cost=0.42..2.13 rows=1 width=26) (actual rows= loops=)

  • Index Cond: ((id)::text = (x66.document_id)::text)
  • Filter: (deleted_at IS NULL)
16. 0.000 0.000 ↓ 0.0

Index Scan using user_document_permission_document_organisation_id_document__key on user_document_permission x18 (cost=0.55..8.58 rows=1 width=63) (actual rows= loops=)

  • Index Cond: (((document_organisation_id)::text = (x39.organisation_id)::text) AND ((document_id)::text = (x39.document_id)::text) AND (valid_until = '294276-01-01 00:00:00'::timestamp without time zone))