explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Qocy

Settings
# exclusive inclusive rows x rows loops node
1. 30.846 1,519.919 ↓ 34.0 22,921 1

Sort (cost=2,215,013.91..2,215,015.59 rows=674 width=676) (actual time=1,517.027..1,519.919 rows=22,921 loops=1)

  • Sort Key: de.filed_on, de.number
  • Sort Method: quicksort Memory: 25,356kB
2. 8.163 1,489.073 ↓ 34.0 22,921 1

Merge Left Join (cost=2,214,973.16..2,214,982.24 rows=674 width=676) (actual time=1,429.520..1,489.073 rows=22,921 loops=1)

  • Merge Cond: (de.id = de_3.id)
  • Join Filter: ((de.case_id = de_3.case_id) AND (de.id = dets_2.docket_entry_id))
3. 8.985 1,316.531 ↓ 34.0 22,921 1

Merge Left Join (cost=2,051,936.15..2,051,943.27 rows=674 width=680) (actual time=1,274.268..1,316.531 rows=22,921 loops=1)

  • Merge Cond: (de.id = de_2.id)
  • Join Filter: ((de.case_id = de_2.case_id) AND (de.id = dets_1.docket_entry_id))
4. 10.756 1,051.479 ↓ 34.0 22,921 1

Merge Left Join (cost=1,026,924.06..1,026,929.22 rows=674 width=348) (actual time=1,035.711..1,051.479 rows=22,921 loops=1)

  • Merge Cond: ((de.id = den.id) AND (de.id = den.docket_entry_id))
  • Join Filter: (de.case_id = den.case_id)
5. 8.955 792.837 ↓ 34.0 22,921 1

Sort (cost=1,911.54..1,913.22 rows=674 width=16) (actual time=790.274..792.837 rows=22,921 loops=1)

  • Sort Key: de.id
  • Sort Method: quicksort Memory: 1,843kB
6. 783.882 783.882 ↓ 34.0 22,921 1

Index Scan using ix_docket_entry_case_id on docket_entry de (cost=0.57..1,879.87 rows=674 width=16) (actual time=765.140..783.882 rows=22,921 loops=1)

  • Index Cond: (case_id = 2,000,152,815)
7. 11.911 247.886 ↓ 1,763.2 22,921 1

Sort (cost=1,025,012.52..1,025,012.56 rows=13 width=344) (actual time=245.381..247.886 rows=22,921 loops=1)

  • Sort Key: den.id, den.docket_entry_id
  • Sort Method: quicksort Memory: 10,980kB
8. 2.725 235.975 ↓ 1,763.2 22,921 1

Subquery Scan on den (cost=1,025,012.09..1,025,012.28 rows=13 width=344) (actual time=222.967..235.975 rows=22,921 loops=1)

9. 6.440 233.250 ↓ 1,763.2 22,921 1

Unique (cost=1,025,012.09..1,025,012.15 rows=13 width=509) (actual time=222.901..233.250 rows=22,921 loops=1)

10. 42.870 226.810 ↓ 3,519.5 45,754 1

Sort (cost=1,025,012.09..1,025,012.12 rows=13 width=509) (actual time=222.898..226.810 rows=45,754 loops=1)

  • Sort Key: de_1.id, (CASE (dets.field)::text WHEN 'docket_raw_text'::text THEN 0 WHEN 'docket_nice_text'::text THEN 0 WHEN 'linked_text'::text THEN 0 WHEN 'dar_raw_text'::text THEN 1 WHEN 'dar_nice_text'::text THEN 1 WHEN 'raw_text'::text THEN 2 WHEN 'nice_text'::text THEN 2 ELSE 10 END)
  • Sort Method: quicksort Memory: 23,808kB
11. 16.943 183.940 ↓ 3,519.5 45,754 1

Nested Loop (cost=1.14..1,025,011.85 rows=13 width=509) (actual time=0.088..183.940 rows=45,754 loops=1)

12. 6.550 6.550 ↓ 34.0 22,921 1

Index Only Scan using docket_entry_case_id_id_idx on docket_entry de_1 (cost=0.57..113.34 rows=674 width=8) (actual time=0.021..6.550 rows=22,921 loops=1)

  • Index Cond: (case_id = 2,000,152,815)
  • Heap Fetches: 268
13. 160.447 160.447 ↑ 1.0 2 22,921

Index Scan using docket_entry_text_storage_docket_entry_id_idx on docket_entry_text_storage dets (cost=0.57..1,520.60 rows=2 width=350) (actual time=0.005..0.007 rows=2 loops=22,921)

  • Index Cond: (docket_entry_id = de_1.id)
  • Filter: (CASE (field)::text WHEN 'docket_raw_text'::text THEN 'raw_text'::text WHEN 'docket_nice_text'::text THEN 'nice_text'::text WHEN 'linked_text'::text THEN 'linked_text'::text WHEN 'dar_raw_text'::text THEN 'raw_text'::text WHEN 'dar_nice_text'::text THEN 'nice_text'::text WHEN 'raw_text'::text THEN 'raw_text'::text WHEN 'nice_text'::text THEN 'nice_text'::text WHEN 'courtlink_raw_text'::text THEN 'raw_text'::text WHEN 'courtlink_nice_text'::text THEN 'nice_text'::text ELSE 'what'::text END = 'nice_text'::text)
  • Rows Removed by Filter: 3
14. 3.747 256.067 ↓ 1,763.2 22,921 1

Materialize (cost=1,025,012.09..1,025,012.32 rows=13 width=344) (actual time=238.528..256.067 rows=22,921 loops=1)

15. 8.058 252.320 ↓ 1,763.2 22,921 1

Unique (cost=1,025,012.09..1,025,012.15 rows=13 width=509) (actual time=238.524..252.320 rows=22,921 loops=1)

16. 60.642 244.262 ↓ 3,519.5 45,754 1

Sort (cost=1,025,012.09..1,025,012.12 rows=13 width=509) (actual time=238.521..244.262 rows=45,754 loops=1)

  • Sort Key: de_2.id, (CASE (dets_1.field)::text WHEN 'docket_raw_text'::text THEN 0 WHEN 'docket_nice_text'::text THEN 0 WHEN 'linked_text'::text THEN 0 WHEN 'dar_raw_text'::text THEN 1 WHEN 'dar_nice_text'::text THEN 1 WHEN 'raw_text'::text THEN 2 WHEN 'nice_text'::text THEN 2 ELSE 10 END)
  • Sort Method: quicksort Memory: 34,641kB
17. 16.174 183.620 ↓ 3,519.5 45,754 1

Nested Loop (cost=1.14..1,025,011.85 rows=13 width=509) (actual time=0.102..183.620 rows=45,754 loops=1)

18. 6.999 6.999 ↓ 34.0 22,921 1

Index Only Scan using docket_entry_case_id_id_idx on docket_entry de_2 (cost=0.57..113.34 rows=674 width=8) (actual time=0.025..6.999 rows=22,921 loops=1)

  • Index Cond: (case_id = 2,000,152,815)
  • Heap Fetches: 268
19. 160.447 160.447 ↑ 1.0 2 22,921

Index Scan using docket_entry_text_storage_docket_entry_id_idx on docket_entry_text_storage dets_1 (cost=0.57..1,520.60 rows=2 width=350) (actual time=0.003..0.007 rows=2 loops=22,921)

  • Index Cond: (docket_entry_id = de_2.id)
  • Filter: (CASE (field)::text WHEN 'docket_raw_text'::text THEN 'raw_text'::text WHEN 'docket_nice_text'::text THEN 'nice_text'::text WHEN 'linked_text'::text THEN 'linked_text'::text WHEN 'dar_raw_text'::text THEN 'raw_text'::text WHEN 'dar_nice_text'::text THEN 'nice_text'::text WHEN 'raw_text'::text THEN 'raw_text'::text WHEN 'nice_text'::text THEN 'nice_text'::text WHEN 'courtlink_raw_text'::text THEN 'raw_text'::text WHEN 'courtlink_nice_text'::text THEN 'nice_text'::text ELSE 'what'::text END = 'raw_text'::text)
  • Rows Removed by Filter: 3
20. 3.084 164.379 ↓ 1,763.2 22,921 1

Materialize (cost=163,037.01..163,037.24 rows=13 width=12) (actual time=155.225..164.379 rows=22,921 loops=1)

21. 4.165 161.295 ↓ 1,763.2 22,921 1

Unique (cost=163,037.01..163,037.07 rows=13 width=209) (actual time=155.221..161.295 rows=22,921 loops=1)

22. 9.173 157.130 ↓ 1,763.2 22,921 1

Sort (cost=163,037.01..163,037.04 rows=13 width=209) (actual time=155.219..157.130 rows=22,921 loops=1)

  • Sort Key: de_3.id, (CASE (dets_2.field)::text WHEN 'docket_raw_text'::text THEN 0 WHEN 'docket_nice_text'::text THEN 0 WHEN 'linked_text'::text THEN 0 WHEN 'dar_raw_text'::text THEN 1 WHEN 'dar_nice_text'::text THEN 1 WHEN 'raw_text'::text THEN 2 WHEN 'nice_text'::text THEN 2 ELSE 10 END)
  • Sort Method: quicksort Memory: 2,559kB
23. 4.197 147.957 ↓ 1,763.2 22,921 1

Nested Loop (cost=1.14..163,036.77 rows=13 width=209) (actual time=0.118..147.957 rows=22,921 loops=1)

24. 6.234 6.234 ↓ 34.0 22,921 1

Index Only Scan using docket_entry_case_id_id_idx on docket_entry de_3 (cost=0.57..113.34 rows=674 width=8) (actual time=0.042..6.234 rows=22,921 loops=1)

  • Index Cond: (case_id = 2,000,152,815)
  • Heap Fetches: 268
25. 137.526 137.526 ↑ 2.0 1 22,921

Index Only Scan using docket_entry_text_storage_pkey on docket_entry_text_storage dets_2 (cost=0.57..241.71 rows=2 width=18) (actual time=0.005..0.006 rows=1 loops=22,921)

  • Index Cond: (docket_entry_id = de_3.id)
  • Filter: (CASE (field)::text WHEN 'docket_raw_text'::text THEN 'raw_text'::text WHEN 'docket_nice_text'::text THEN 'nice_text'::text WHEN 'linked_text'::text THEN 'linked_text'::text WHEN 'dar_raw_text'::text THEN 'raw_text'::text WHEN 'dar_nice_text'::text THEN 'nice_text'::text WHEN 'raw_text'::text THEN 'raw_text'::text WHEN 'nice_text'::text THEN 'nice_text'::text WHEN 'courtlink_raw_text'::text THEN 'raw_text'::text WHEN 'courtlink_nice_text'::text THEN 'nice_text'::text ELSE 'what'::text END = 'linked_text'::text)
  • Rows Removed by Filter: 4
  • Heap Fetches: 49,837
Planning time : 2.276 ms