explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hRM9

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 47,396.129 ↓ 0.0 0 1

GroupAggregate (cost=502,942.62..502,947.74 rows=205 width=308) (actual time=47,396.129..47,396.129 rows=0 loops=1)

  • Group Key: paragraph_evdcs.paragraph_id, paragraphs.paragraph
2.          

CTE task_evdcs

3. 3.053 246.851 ↓ 3.0 3,828 1

Nested Loop (cost=1,000.87..160,073.15 rows=1,259 width=87) (actual time=193.315..246.851 rows=3,828 loops=1)

4. 0.000 220.830 ↓ 3.0 3,828 1

Nested Loop (cost=1,000.43..149,406.89 rows=1,259 width=16) (actual time=193.282..220.830 rows=3,828 loops=1)

5. 109.283 194.259 ↓ 1.4 70 1

Gather (cost=1,000.00..39,462.36 rows=51 width=4) (actual time=193.195..194.259 rows=70 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 84.976 84.976 ↓ 1.1 23 3 / 3

Parallel Seq Scan on pages pages_6 (cost=0.00..38,457.26 rows=21 width=4) (actual time=71.416..84.976 rows=23 loops=3)

  • Filter: (10599 = ANY (task_ids))
  • Rows Removed by Filter: 113,117
7. 9.171 26.880 ↑ 3.7 55 70

Index Scan using evdc_page_id_index on evdcs evdcs_1 (cost=0.43..2,153.76 rows=202 width=20) (actual time=0.056..0.384 rows=55 loops=70)

  • Index Cond: (page_id = pages_6.id)
  • Filter: ((((SubPlan 3) OR (alternatives: SubPlan 6 or hashed SubPlan 7)) AND (alternatives: SubPlan 8 or hashed SubPlan 9) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))) OR (current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))
8.          

SubPlan (for Index Scan)

9. 0.000 0.000 ↓ 0.0 0 3,828

Index Scan using paragraphs_pkey on paragraphs paragraphs_1 (cost=0.43..5.30 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=3,828)

  • Index Cond: (id = evdcs_1.paragraph_id)
  • Filter: ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted) OR ((alternatives: SubPlan 1 or hashed SubPlan 2) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))))
10.          

SubPlan (for Index Scan)

11. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages (cost=0.42..2.64 rows=1 width=0) (never executed)

  • Index Cond: (id = paragraphs_1.page_id)
  • Heap Fetches: 0
12. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_1 (cost=0.42..13,531.62 rows=338,054 width=4) (never executed)

  • Heap Fetches: 0
13. 6.714 6.714 ↑ 1.0 1 3,357

Index Only Scan using tables_pkey on tables (cost=0.42..2.64 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=3,357)

  • Index Cond: (id = evdcs_1.table_id)
  • Heap Fetches: 0
14. 0.000 0.000 ↓ 0.0 0

Index Only Scan using tables_pkey on tables tables_1 (cost=0.42..6,886.82 rows=383,819 width=4) (never executed)

  • Heap Fetches: 0
15. 10.995 10.995 ↑ 1.0 1 3,665

Index Only Scan using pages_pkey on pages pages_2 (cost=0.42..2.64 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=3,665)

  • Index Cond: (id = evdcs_1.page_id)
  • Heap Fetches: 3,665
16. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_3 (cost=0.42..13,531.62 rows=338,054 width=4) (never executed)

  • Heap Fetches: 0
17. 16.580 22.968 ↑ 1.0 1 3,828

Index Scan using evd_components_pkey on evd_components evd_components_1 (cost=0.44..8.47 rows=1 width=80) (actual time=0.006..0.006 rows=1 loops=3,828)

  • Index Cond: (id = evdcs_1.evd_component_value_id)
  • Filter: ((((SubPlan 12) OR (alternatives: SubPlan 15 or hashed SubPlan 16)) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))) OR (current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))
18.          

SubPlan (for Index Scan)

19. 0.000 0.000 ↓ 0.0 0 3,828

Index Scan using paragraphs_pkey on paragraphs paragraphs_2 (cost=0.43..5.30 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=3,828)

  • Index Cond: (id = evd_components_1.paragraph_id)
  • Filter: ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted) OR ((alternatives: SubPlan 10 or hashed SubPlan 11) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))))
20.          

SubPlan (for Index Scan)

21. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_4 (cost=0.42..2.64 rows=1 width=0) (never executed)

  • Index Cond: (id = paragraphs_2.page_id)
  • Heap Fetches: 0
22. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_5 (cost=0.42..13,531.62 rows=338,054 width=4) (never executed)

  • Heap Fetches: 0
23. 6.388 6.388 ↑ 1.0 1 3,194

Index Only Scan using tables_pkey on tables tables_2 (cost=0.42..2.64 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=3,194)

  • Index Cond: (id = evd_components_1.table_id)
  • Heap Fetches: 0
24. 0.000 0.000 ↓ 0.0 0

Index Only Scan using tables_pkey on tables tables_3 (cost=0.42..6,886.82 rows=383,819 width=4) (never executed)

  • Heap Fetches: 0
25.          

CTE table_evdcs

26. 56.597 56.597 ↓ 2.2 2,718 1

CTE Scan on task_evdcs (cost=0.00..25.18 rows=1,246 width=44) (actual time=0.001..56.597 rows=2,718 loops=1)

  • Filter: ((table_id IS NOT NULL) AND (numeric_value IS NOT NULL))
  • Rows Removed by Filter: 1,110
27.          

CTE paragraph_evdcs

28. 195.570 195.570 ↑ 2.6 471 1

CTE Scan on task_evdcs task_evdcs_1 (cost=0.00..25.18 rows=1,246 width=20) (actual time=193.990..195.570 rows=471 loops=1)

  • Filter: ((paragraph_id IS NOT NULL) AND (numeric_value IS NOT NULL))
  • Rows Removed by Filter: 3,357
29. 0.028 47,396.127 ↓ 0.0 0 1

Sort (cost=342,819.11..342,819.62 rows=205 width=156) (actual time=47,396.127..47,396.127 rows=0 loops=1)

  • Sort Key: paragraph_evdcs.paragraph_id, paragraphs.paragraph
  • Sort Method: quicksort Memory: 25kB
30. 0.000 47,396.099 ↓ 0.0 0 1

Nested Loop (cost=1.30..342,811.24 rows=205 width=156) (actual time=47,396.099..47,396.099 rows=0 loops=1)

31. 0.804 47,396.099 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.87..341,709.39 rows=208 width=20) (actual time=47,396.099..47,396.099 rows=0 loops=1)

  • Join Filter: (paragraph_evdcs.numeric_value = (evd_components.numeric_value)::real)
32. 199.244 47,394.857 ↓ 1.1 438 1

CTE Scan on paragraph_evdcs (cost=0.00..338,030.46 rows=415 width=20) (actual time=340.670..47,394.857 rows=438 loops=1)

  • Filter: ((SubPlan 20) > 0)
  • Rows Removed by Filter: 33
33.          

SubPlan (for CTE Scan)

34. 8.478 47,195.613 ↑ 1.0 1 471

Aggregate (cost=271.26..271.27 rows=1 width=8) (actual time=100.203..100.203 rows=1 loops=471)

35. 47,187.135 47,187.135 ↑ 2.0 50 471

CTE Scan on table_evdcs (cost=0.00..271.01 rows=102 width=0) (actual time=28.751..100.185 rows=50 loops=471)

  • Filter: ((((paragraph_evdcs.numeric_value)::numeric)::double precision = numeric_value) OR (((paragraph_evdcs.numeric_value)::numeric)::double precision = (numeric_value * '1000'::double precision)) OR (((paragraph_evdcs.numeric_value)::numeric)::double precision = (numeric_value * '1000000'::double precision)) OR (((paragraph_evdcs.numeric_value)::numeric)::double precision = (numeric_value / '1000'::double precision)) OR (((paragraph_evdcs.numeric_value)::numeric)::double precision = (numeric_value / '1000000'::double precision)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-1'::integer) * '1000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-1'::integer) * '1000000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-1'::integer) / '1000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-1'::integer) / '1000000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-2'::integer) * '1000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-2'::integer) * '1000000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-2'::integer) / '1000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-2'::integer) / '1000000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-3'::integer) * '1000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-3'::integer) * '1000000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-3'::integer) / '1000'::numeric)) OR ((paragraph_evdcs.numeric_value)::numeric = (round((numeric_value)::numeric, '-3'::integer) / '1000000'::numeric)))
  • Rows Removed by Filter: 2,668
36. 0.138 0.438 ↓ 0.0 0 438

Materialize (cost=0.87..2,827.05 rows=124 width=5) (actual time=0.001..0.001 rows=0 loops=438)

37. 0.001 0.300 ↓ 0.0 0 1

Nested Loop (cost=0.87..2,826.43 rows=124 width=5) (actual time=0.300..0.300 rows=0 loops=1)

38. 0.299 0.299 ↓ 0.0 0 1

Index Scan using evdcs_pkey on evdcs (cost=0.43..1,511.41 rows=124 width=4) (actual time=0.299..0.299 rows=0 loops=1)

  • Index Cond: (id = ANY ('{10424168,10424169,10424170,10424171,10424172,10424173,10424174,10424175,10424176,10424177,10424178,10424179,10424180,10424181,10424182,10424183,10424184,10424185,10424186,10424187,10424188,10424189,10424190,10424191,10424192,10424193,10424194,10424195,10424196,10424197,10424198,10424199,10424200,10424201,10424202,10424203,10424204,10424205,10424206,10424207,10424208,10424209,10424210,10424211,10424212,10424213,10424214,10424215,10424216,10424217,10424218,10424219,10424220,10424221,10424222,10424223,10424224,10424225,10424226,10424227,10424228,10424229,10424230,10424231,10424232,10424233,10424234,10424235,10424236,10424237,10424238,10424239,10424240,10424241,10424242,10424243,10424244,10424245,10424246,10424247,10424248,10424249,10424250,10424251,10424252,10424253,10424254,10424255,10424256,10424257,10424258,10424259,10424260,10424261,10424262,10424263,10424264,10424265,10424266,10424267,10424268,10424269,10424270,10424271,10424272,10424273,10424274,10424275,10424276,10424277,10424278,10424279,10424280,10424281,10424282,10424283,10424284,10424285,10424286,10424287,10424288,10424289,10424290,10424291}'::integer[]))
  • Filter: ((((SubPlan 32) OR (alternatives: SubPlan 35 or hashed SubPlan 36)) AND (alternatives: SubPlan 37 or hashed SubPlan 38) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))) OR (current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))
39.          

SubPlan (for Index Scan)

40. 0.000 0.000 ↓ 0.0 0

Index Scan using paragraphs_pkey on paragraphs paragraphs_4 (cost=0.43..5.30 rows=1 width=0) (never executed)

  • Index Cond: (id = evdcs.paragraph_id)
  • Filter: ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted) OR ((alternatives: SubPlan 30 or hashed SubPlan 31) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))))
41.          

SubPlan (for Index Scan)

42. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_11 (cost=0.42..2.64 rows=1 width=0) (never executed)

  • Index Cond: (id = paragraphs_4.page_id)
  • Heap Fetches: 0
43. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_12 (cost=0.42..13,531.62 rows=338,054 width=4) (never executed)

  • Heap Fetches: 0
44. 0.000 0.000 ↓ 0.0 0

Index Only Scan using tables_pkey on tables tables_6 (cost=0.42..2.64 rows=1 width=0) (never executed)

  • Index Cond: (id = evdcs.table_id)
  • Heap Fetches: 0
45. 0.000 0.000 ↓ 0.0 0

Index Only Scan using tables_pkey on tables tables_7 (cost=0.42..6,886.82 rows=383,819 width=4) (never executed)

  • Heap Fetches: 0
46. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_13 (cost=0.42..2.64 rows=1 width=0) (never executed)

  • Index Cond: (id = evdcs.page_id)
  • Heap Fetches: 0
47. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_14 (cost=0.42..13,531.62 rows=338,054 width=4) (never executed)

  • Heap Fetches: 0
48. 0.000 0.000 ↓ 0.0 0

Index Scan using evd_components_pkey on evd_components (cost=0.44..10.61 rows=1 width=9) (never executed)

  • Index Cond: (id = evdcs.evd_component_value_id)
  • Filter: ((((SubPlan 25) OR (alternatives: SubPlan 28 or hashed SubPlan 29)) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))) OR (current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))
49.          

SubPlan (for Index Scan)

50. 0.000 0.000 ↓ 0.0 0

Index Scan using paragraphs_pkey on paragraphs paragraphs_3 (cost=0.43..5.30 rows=1 width=0) (never executed)

  • Index Cond: (id = evd_components.paragraph_id)
  • Filter: ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted) OR ((alternatives: SubPlan 23 or hashed SubPlan 24) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))))
51.          

SubPlan (for Index Scan)

52. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_9 (cost=0.42..2.64 rows=1 width=0) (never executed)

  • Index Cond: (id = paragraphs_3.page_id)
  • Heap Fetches: 0
53. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_10 (cost=0.42..13,531.62 rows=338,054 width=4) (never executed)

  • Heap Fetches: 0
54. 0.000 0.000 ↓ 0.0 0

Index Only Scan using tables_pkey on tables tables_4 (cost=0.42..2.64 rows=1 width=0) (never executed)

  • Index Cond: (id = evd_components.table_id)
  • Heap Fetches: 0
55. 0.000 0.000 ↓ 0.0 0

Index Only Scan using tables_pkey on tables tables_5 (cost=0.42..6,886.82 rows=383,819 width=4) (never executed)

  • Heap Fetches: 0
56. 0.000 0.000 ↓ 0.0 0

Index Scan using paragraphs_pkey on paragraphs (cost=0.43..5.30 rows=1 width=140) (never executed)

  • Index Cond: (id = paragraph_evdcs.paragraph_id)
  • Filter: ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted) OR ((alternatives: SubPlan 21 or hashed SubPlan 22) AND ((current_setting('rls.show_deleted'::text, true) = 'true'::text) OR (NOT is_deleted))))
57.          

SubPlan (for Index Scan)

58. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_7 (cost=0.42..2.64 rows=1 width=0) (never executed)

  • Index Cond: (id = paragraphs.page_id)
  • Heap Fetches: 0
59. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pages_pkey on pages pages_8 (cost=0.42..13,531.62 rows=338,054 width=4) (never executed)

  • Heap Fetches: 0
Planning time : 5.786 ms
Execution time : 47,398.553 ms