explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eD8Z

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 6,260.065 ↑ 4.3 231 1

Limit (cost=183,153.16..183,155.66 rows=1,000 width=759) (actual time=6,259.927..6,260.065 rows=231 loops=1)

2. 0.665 6,260.045 ↑ 29.0 231 1

Sort (cost=183,153.16..183,169.88 rows=6,688 width=759) (actual time=6,259.927..6,260.045 rows=231 loops=1)

  • Sort Key: issues.updated_at DESC
  • Sort Method: quicksort Memory: 358kB
3. 0.681 6,259.380 ↑ 29.0 231 1

Nested Loop (cost=3,424.26..182,786.47 rows=6,688 width=759) (actual time=29.743..6,259.380 rows=231 loops=1)

4. 3.305 6,256.521 ↑ 29.1 242 1

Nested Loop (cost=3,423.82..153,965.69 rows=7,046 width=763) (actual time=29.722..6,256.521 rows=242 loops=1)

5. 6,177.639 6,214.752 ↑ 5.2 2,404 1

Bitmap Heap Scan on issues (cost=3,423.39..69,750.82 rows=12,513 width=759) (actual time=29.683..6,214.752 rows=2,404 loops=1)

  • Recheck Cond: (((title)::text ~~* '%amex%'::text) OR (description ~~* '%amex%'::text))
  • Rows Removed by Index Recheck: 8322
  • Filter: ((confidential IS NOT TRUE) OR (confidential AND ((author_id = 64248) OR (alternatives: SubPlan 1 or hashed SubPlan 2) OR (hashed SubPlan 3))))
  • Rows Removed by Filter: 25
  • Heap Blocks: exact=10109
6. 0.000 26.682 ↓ 0.0 0 1

BitmapOr (cost=409.18..409.18 rows=12,723 width=0) (actual time=26.682..26.682 rows=0 loops=1)

7. 4.717 4.717 ↑ 2.2 696 1

Bitmap Index Scan on index_issues_on_title_trigram (cost=0.00..44.24 rows=1,499 width=0) (actual time=4.717..4.717 rows=696 loops=1)

  • Index Cond: ((title)::text ~~* '%amex%'::text)
8. 21.965 21.965 ↑ 1.1 10,444 1

Bitmap Index Scan on index_issues_on_description_trigram (cost=0.00..358.68 rows=11,223 width=0) (actual time=21.965..21.965 rows=10,444 loops=1)

  • Index Cond: (description ~~* '%amex%'::text)
9.          

SubPlan (for Bitmap Heap Scan)

10. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_issue_assignees_on_issue_id_and_user_id on issue_assignees (cost=0.43..3.45 rows=1 width=0) (never executed)

  • Index Cond: ((issue_id = issues.id) AND (user_id = 64248))
  • Heap Fetches: 0
11. 1.286 1.286 ↓ 8.5 465 1

Index Scan using index_issue_assignees_on_user_id on issue_assignees issue_assignees_1 (cost=0.43..60.52 rows=55 width=4) (actual time=0.020..1.286 rows=465 loops=1)

  • Index Cond: (user_id = 64248)
12. 0.602 9.145 ↓ 1.1 1,460 1

Nested Loop (cost=1.00..3,010.88 rows=1,334 width=4) (actual time=0.045..9.145 rows=1,460 loops=1)

13. 1.243 1.243 ↓ 1.1 1,460 1

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations (cost=0.56..350.90 rows=1,334 width=4) (actual time=0.029..1.243 rows=1,460 loops=1)

  • Index Cond: ((user_id = 64248) AND (access_level >= 20))
  • Heap Fetches: 334
14. 7.300 7.300 ↑ 1.0 1 1,460

Index Only Scan using projects_pkey on projects projects_1 (cost=0.43..1.98 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1,460)

  • Index Cond: (id = project_authorizations.project_id)
  • Heap Fetches: 311
15. 26.444 38.464 ↓ 0.0 0 2,404

Index Scan using projects_pkey on projects (cost=0.43..6.72 rows=1 width=4) (actual time=0.016..0.016 rows=0 loops=2,404)

  • Index Cond: (id = issues.project_id)
  • Filter: ((alternatives: SubPlan 4 or hashed SubPlan 5) OR (visibility_level = 20))
  • Rows Removed by Filter: 1
16.          

SubPlan (for Index Scan)

17. 12.020 12.020 ↓ 0.0 0 2,404

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_1 (cost=0.56..3.58 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=2,404)

  • Index Cond: ((user_id = 64248) AND (project_id = projects.id))
  • Heap Fetches: 0
18. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_2 (cost=0.56..355.11 rows=1,368 width=4) (never executed)

  • Index Cond: (user_id = 64248)
  • Heap Fetches: 0
19. 2.175 2.178 ↑ 1.0 1 242

Index Scan using index_project_features_on_project_id on project_features (cost=0.43..4.08 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=242)

  • Index Cond: (project_id = projects.id)
  • Filter: ((issues_access_level = ANY ('{NULL,20,30}'::integer[])) OR ((issues_access_level = 10) AND (alternatives: SubPlan 6 or hashed SubPlan 7)))
  • Rows Removed by Filter: 0
20.          

SubPlan (for Index Scan)

21. 0.003 0.003 ↓ 0.0 0 1

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_3 (cost=0.56..3.58 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: ((user_id = 64248) AND (project_id = projects.id))
  • Heap Fetches: 0
22. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_4 (cost=0.56..355.11 rows=1,368 width=4) (never executed)

  • Index Cond: (user_id = 64248)
  • Heap Fetches: 0
Planning time : 13.012 ms
Execution time : 6,260.266 ms