explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Am2M

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 35.171 ↑ 1.0 1 1

Limit (cost=459.42..1,420.05 rows=1 width=4) (actual time=35.163..35.171 rows=1 loops=1)

  • Output: tnew.id
2. 0.001 35.162 ↑ 1.0 1 1

Subquery Scan on tnew (cost=459.42..1,420.05 rows=1 width=4) (actual time=35.162..35.162 rows=1 loops=1)

  • Output: tnew.id
3. 3.724 35.161 ↑ 1.0 1 1

Foreign Scan on catalog.tracks_rights t (cost=459.42..1,420.04 rows=1 width=490) (actual time=35.161..35.161 rows=1 loops=1)

  • Output: t.id, NULL::character varying, NULL::character varying, NULL::character varying, NULL::date, NULL::character varying, NULL::character varying, NULL::uuid, NULL::integer, NULL::integer, NULL::integer, NULL::json, NULL::character varying, NULL::integer, NULL::json, NULL::character varying, NULL::boolean, NULL::character varying, NULL::json, NULL::json, NULL::json, NULL::boolean, NULL::character varying
  • Filter: ((('now'::cstring)::date <@ t.validity_range) AND (lower(((SubPlan 8) ->> 'title'::text)) = 'dopamine'::text))
  • Remote SQL: SELECT id, validity_range FROM catalog.view_tracks_rights WHERE (active) AND ((id_account = $1::integer)) AND ((lower(isrc) = 'fr9w12014466'::text)) AND ((id_territory = ANY ($2::integer[])))
4.          

CTE project_account

5. 1.487 1.489 ↑ 1.0 1 1

Foreign Scan on api.project_account (cost=100.02..183.16 rows=1 width=4) (actual time=1.488..1.489 rows=1 loops=1)

  • Output: project_account.id_account
  • Remote SQL: SELECT id_account FROM api.project_account WHERE ((id_project = $1::integer)) AND ((id_project = ANY ($2::integer[])))
6.          

Initplan (for Foreign Scan)

7. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.001 rows=1 loops=1)

  • Output: '{1}'::integer[]
8. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1)

  • Output: 1
9.          

CTE project_territories

10. 1.573 1.574 ↑ 1.0 1 1

Foreign Scan (cost=100.37..176.21 rows=1 width=32) (actual time=1.573..1.574 rows=1 loops=1)

  • Output: (array_agg(project_territory.id_territory))
  • Relations: Aggregate on (api.project_territory)
  • Remote SQL: SELECT array_agg(id_territory) FROM api.project_territory WHERE ((id_project = ANY ($1::integer[])))
11.          

Initplan (for Foreign Scan)

12. 0.001 0.001 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1)

  • Output: '{1}'::integer[]
13.          

Initplan (for Foreign Scan)

14. 1.492 1.492 ↑ 1.0 1 1

CTE Scan on project_account pa (cost=0.00..0.02 rows=1 width=4) (actual time=1.490..1.492 rows=1 loops=1)

  • Output: pa.id_account
15. 1.576 1.576 ↑ 1.0 1 1

CTE Scan on project_territories pt (cost=0.00..0.02 rows=1 width=32) (actual time=1.574..1.576 rows=1 loops=1)

  • Output: pt.id_territory
16.          

SubPlan (for Foreign Scan)

17. 28.369 28.369 ↑ 1.0 1 1

Result (cost=0.00..0.26 rows=1 width=32) (actual time=28.368..28.369 rows=1 loops=1)

  • Output: catalog.sp_get_track_album(t.id, NULL::character varying)
Planning time : 0.493 ms
Execution time : 37.835 ms