explain.depesz.com

PostgreSQL's explain analyze made readable

Result: maEn6

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 322.985 ↓ 0.0 0 1

GroupAggregate (cost=222,344.99..222,350.11 rows=205 width=308) (actual time=322.985..322.985 rows=0 loops=1)

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

CTE task_evdcs

3. 6.093 312.666 ↓ 3.0 3,828 1

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

4. 0.055 283.605 ↓ 3.0 3,828 1

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

5. 143.576 255.830 ↓ 1.4 70 1

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

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

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

  • Filter: (10599 = ANY (task_ids))
  • Rows Removed by Filter: 113,117
7. 10.011 27.720 ↑ 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.043..0.396 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. 12.752 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. 3.828 3.828 ↓ 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.001..0.001 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. 59.214 59.214 ↓ 2.2 2,718 1

CTE Scan on task_evdcs (cost=0.00..25.18 rows=1,246 width=44) (actual time=0.001..59.214 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. 258.237 258.237 ↑ 1,246.0 1 1

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

  • Filter: ((paragraph_id IS NOT NULL) AND (numeric_value IS NOT NULL))
  • Rows Removed by Filter: 139
29. 0.009 322.984 ↓ 0.0 0 1

Sort (cost=62,221.48..62,221.99 rows=205 width=156) (actual time=322.984..322.984 rows=0 loops=1)

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

Nested Loop (cost=2,829.96..62,213.60 rows=205 width=156) (actual time=322.975..322.975 rows=0 loops=1)

31. 0.015 322.975 ↓ 0.0 0 1

Hash Join (cost=2,829.53..61,111.76 rows=208 width=20) (actual time=322.975..322.975 rows=0 loops=1)

  • Hash Cond: (paragraph_evdcs.numeric_value = (evd_components.numeric_value)::real)
32. 258.248 322.615 ↑ 415.0 1 1

CTE Scan on paragraph_evdcs (cost=0.00..58,278.54 rows=415 width=20) (actual time=322.615..322.615 rows=1 loops=1)

  • Filter: ((SubPlan 20) > 0)
33.          

SubPlan (for CTE Scan)

34. 0.009 64.367 ↑ 1.0 1 1

Aggregate (cost=46.74..46.75 rows=1 width=8) (actual time=64.367..64.367 rows=1 loops=1)

35. 64.358 64.358 ↑ 2.0 3 1

CTE Scan on table_evdcs (cost=0.00..46.73 rows=6 width=0) (actual time=13.887..64.358 rows=3 loops=1)

  • Filter: (ARRAY[(paragraph_evdcs.numeric_value)::double precision] <@ ARRAY[(numeric_value)::double precision, (numeric_value * '1000'::double precision), (numeric_value * '1000000'::double precision), (numeric_value / '1000'::double precision), (numeric_value / '1000000'::double precision)])
  • Rows Removed by Filter: 2,715
36. 0.000 0.345 ↓ 0.0 0 1

Hash (cost=2,827.98..2,827.98 rows=124 width=5) (actual time=0.345..0.345 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
37. 0.004 0.345 ↓ 0.0 0 1

HashAggregate (cost=2,826.74..2,827.98 rows=124 width=5) (actual time=0.345..0.345 rows=0 loops=1)

  • Group Key: (evd_components.numeric_value)::real
38. 0.000 0.341 ↓ 0.0 0 1

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

39. 0.341 0.341 ↓ 0.0 0 1

Index Scan using evdcs_pkey on evdcs (cost=0.43..1,511.41 rows=124 width=4) (actual time=0.340..0.341 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))
40.          

SubPlan (for Index Scan)

41. 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))))
42.          

SubPlan (for Index Scan)

43. 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
44. 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
45. 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
46. 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
47. 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
48. 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
49. 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))
50.          

SubPlan (for Index Scan)

51. 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))))
52.          

SubPlan (for Index Scan)

53. 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
54. 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
55. 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
56. 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
57. 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))))
58.          

SubPlan (for Index Scan)

59. 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
60. 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 : 3.384 ms
Execution time : 325.067 ms