explain.depesz.com

A tool for finding a real cause for slow queries.

Result: RYT

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.006 17,022.580 ↓ 3.0 3 1

Limit (cost=34,879.56..34,879.57 rows=1 width=3) (actual time=17,022.573..17,022.580 rows=3 loops=1)

2. 0.031 17,022.574 ↓ 3.0 3 1

Sort (cost=34,879.56..34,879.57 rows=1 width=3) (actual time=17,022.571..17,022.574 rows=3 loops=1)

  • Sort Key: (CASE WHEN ((c.sg_status_list)::text = 'prjd'::text) THEN 0 WHEN ((c.sg_status_list)::text = 'awrd'::text) THEN 1 WHEN ((c.sg_status_list)::text = 'hld'::text) THEN 2 WHEN ((c.sg_status_list)::text = 'omt'::text) THEN 3 WHEN ((c.sg_stat
  • Sort Method: quicksort Memory: 25kB
3. 0.576 17,022.543 ↓ 3.0 3 1

HashAggregate (cost=34,879.51..34,879.55 rows=1 width=3) (actual time=17,022.539..17,022.543 rows=3 loops=1)

4. 2.072 17,021.967 ↓ 567.0 567 1

Nested Loop Left Join (cost=18,104.25..34,879.51 rows=1 width=3) (actual time=398.464..17,021.967 rows=567 loops=1)

  • Join Filter: ((a.entity_type)::text = 'Asset'::text)
5. 17.781 17,017.627 ↓ 567.0 567 1

Merge Join (cost=18,104.25..34,877.66 rows=1 width=9) (actual time=398.406..17,017.627 rows=567 loops=1)

  • Merge Cond: (b.entity_id = a.entity_id)
  • Join Filter: ((a.entity_type)::text = (b.entity_type)::text)
6. 16,814.529 16,814.529 ↑ 4.1 13,178 1

Index Scan using dneg_dnc_entity_id on display_name_caches b (cost=0.00..813,687.84 rows=53,661 width=13) (actual time=0.276..16,814.529 rows=13,178 loops=1)

  • Filter: (lower((entity_derived_type)::text) = 'asset'::text)
7. 10.668 185.317 ↑ 5.2 568 1

Sort (cost=18,104.25..18,111.60 rows=2,940 width=9) (actual time=184.779..185.317 rows=568 loops=1)

  • Sort Key: a.entity_id
  • Sort Method: quicksort Memory: 497kB
8. 174.649 174.649 ↓ 2.3 6,649 1

Seq Scan on tasks a (cost=0.00..17,934.88 rows=2,940 width=9) (actual time=0.185..174.649 rows=6,649 loops=1)

  • Filter: ((task_template_id IS NULL) AND (retirement_date IS NULL) AND (project_id = 103) AND ((lower((sg_status_list)::text) = 'asd'::text) OR (lower((sg_status_list)::text) = 'asm'::text) OR (lower((sg_status_list):
9. 2.268 2.268 ↑ 1.0 1 567

Index Scan using assets_pkey on assets c (cost=0.00..1.83 rows=1 width=7) (actual time=0.003..0.004 rows=1 loops=567)

  • Index Cond: (c.id = a.entity_id)
  • Filter: (c.retirement_date IS NULL)