explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YNDK

Settings
# exclusive inclusive rows x rows loops node
1. 0.314 24.698 ↓ 9.0 9 1

Limit (cost=1,325.02..1,474.24 rows=1 width=62) (actual time=18.142..24.698 rows=9 loops=1)

2. 1.467 24.384 ↓ 4.1 29 1

Result (cost=280.46..1,325.02 rows=7 width=62) (actual time=1.843..24.384 rows=29 loops=1)

3. 0.592 1.225 ↓ 4.1 29 1

Sort (cost=280.46..280.48 rows=7 width=54) (actual time=0.986..1.225 rows=29 loops=1)

  • Sort Key: (CASE WHEN (project.status = 'UNDER_REVIEW'::text) THEN '1'::numeric WHEN (project.status = 'DRAFT'::text) THEN '2'::numeric WHEN ((project."fundingEndedAt" IS NOT NULL) AND (((project."fundingEndedAt")::date - '2020-09-07'::date) < 10) AND (project.status = 'PUBLISHED'::text)) THEN '3'::numeric WHEN (project.status = 'PUBLISHED'::text) THEN CASE WHEN (('2020-09-07'::date - (project."publishedAt")::date) < 15) THEN 3.5 ELSE '4'::numeric END WHEN (project.status = 'FROZEN'::text) THEN 4.5 WHEN (project.status = 'CASHEDOUT'::text) THEN '5'::numeric WHEN (project.status = 'DELIVERED'::text) THEN '6'::numeric WHEN (project.status = 'ENDED'::text) THEN '7'::numeric WHEN (project.status = 'CANCELLED'::text) THEN '8'::numeric ELSE '9'::numeric END), project."updatedAt" DESC
  • Sort Method: quicksort Memory: 27kB
4. 0.410 0.633 ↓ 4.1 29 1

Bitmap Heap Scan on project (cost=43.91..280.37 rows=7 width=54) (actual time=0.247..0.633 rows=29 loops=1)

  • Recheck Cond: (("organizationId" = 3) AND (status = ANY ('{UNDER_REVIEW,DRAFT,PUBLISHED,FROZEN,CANCELLED,CASHEDOUT,DELIVERED,ENDED}'::text[])))
  • Filter: (("deletedAt" IS NULL) AND (("authorId" = 80) OR (status = ANY ('{PUBLISHED,FROZEN,CASHEDOUT,DELIVERED,ENDED,TEMPLATE,CANCELLED,UNDER_REVIEW}'::text[])) OR (id = ANY ('{158,280,287,308,399,400,386,43,530,1118,1451,829,1710,51,2420,52,2516,2718}'::bigint[]))))
  • Rows Removed by Filter: 43
  • Heap Blocks: exact=57
5. 0.024 0.223 ↓ 0.0 0 1

BitmapAnd (cost=43.91..43.91 rows=93 width=0) (actual time=0.215..0.223 rows=0 loops=1)

6. 0.036 0.036 ↑ 1.0 167 1

Bitmap Index Scan on idx_16492_project_organization_id (cost=0.00..5.53 rows=167 width=0) (actual time=0.028..0.036 rows=167 loops=1)

  • Index Cond: ("organizationId" = 3)
7. 0.163 0.163 ↑ 1.0 1,585 1

Bitmap Index Scan on idx_16492_project_status (cost=0.00..38.12 rows=1,585 width=0) (actual time=0.155..0.163 rows=1,585 loops=1)

  • Index Cond: (status = ANY ('{UNDER_REVIEW,DRAFT,PUBLISHED,FROZEN,CANCELLED,CASHEDOUT,DELIVERED,ENDED}'::text[]))
8.          

SubPlan (for Result)

9. 1.479 17.980 ↑ 1.0 1 29

Aggregate (cost=128.95..128.97 rows=1 width=4) (actual time=0.607..0.620 rows=1 loops=29)

10. 16.501 16.501 ↑ 1.0 2 29

Seq Scan on "projectOrganizer" (cost=0.00..128.95 rows=2 width=8) (actual time=0.175..0.569 rows=2 loops=29)

  • Filter: (("deletedAt" IS NULL) AND ("projectId" = project.id))
  • Rows Removed by Filter: 6,074
11. 0.841 3.712 ↑ 1.0 1 29

Aggregate (cost=20.19..20.21 rows=1 width=4) (actual time=0.118..0.128 rows=1 loops=29)

12. 2.871 2.871 ↓ 0.0 0 29

Seq Scan on "projectParticipant" (cost=0.00..20.18 rows=7 width=4) (actual time=0.099..0.099 rows=0 loops=29)

  • Filter: (("deletedAt" IS NULL) AND ("projectId" = project.id))
  • Rows Removed by Filter: 974
Planning time : 0.532 ms
Execution time : 25.027 ms