explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Kz2v

Settings
# exclusive inclusive rows x rows loops node
1. 8.863 3,240.234 ↓ 3,333.3 100,000 1

Limit (cost=3,345.46..3,345.53 rows=30 width=262) (actual time=3,196.450..3,240.234 rows=100,000 loops=1)

2. 1,480.134 3,231.371 ↓ 3,333.3 100,000 1

Sort (cost=3,345.46..3,345.53 rows=30 width=262) (actual time=3,196.448..3,231.371 rows=100,000 loops=1)

  • Sort Key: "Turnovers".import, "Turnovers"."docDate
  • Sort Method: external merge Disk: 61624kB
3. 191.236 1,751.237 ↓ 8,654.9 259,647 1

Nested Loop (cost=2.38..3,344.72 rows=30 width=262) (actual time=0.092..1,751.237 rows=259,647 loops=1)

4. 51.767 781.060 ↓ 8,654.9 259,647 1

Nested Loop (cost=1.95..3,326.92 rows=30 width=343) (actual time=0.078..781.060 rows=259,647 loops=1)

5. 0.015 0.015 ↑ 1.0 1 1

Index Scan using "Endpoints_pkey" on "Endpoints" (cost=0.28..0.52 rows=1 width=32) (actual time=0.013..0.015 rows=1 loops=1)

  • Index Cond: (id = '336769b9-a854-483c-b191-c55b7baa37e7'::uuid)
  • Filter: (client = '4dd0b1dc-7f25-48b1-a504-849de9c5c75f'::uuid)
6. 149.360 729.278 ↓ 8,654.9 259,647 1

Nested Loop (cost=1.67..3,326.10 rows=30 width=359) (actual time=0.062..729.278 rows=259,647 loops=1)

7. 22.420 61.326 ↓ 180.1 21,608 1

Hash Join (cost=1.09..3,227.87 rows=120 width=151) (actual time=0.042..61.326 rows=21,608 loops=1)

  • Hash Cond: ("Nomenclatures".endpoint = CASE WHEN (COALESCE(("Clients".data ->> 'separateNomenclature'::text), 'false'::text) = 'true'::text) THEN '336769b9-a854-483c-b191-c55b7baa37e7'::uuid ELSE '00000000-0000-0000-0000-000000000000'::uuid END)
8. 38.891 38.891 ↑ 1.1 21,608 1

Index Scan using "Nomenclatures_client_index" on "Nomenclatures" (cost=0.56..3,076.09 rows=24,008 width=167) (actual time=0.019..38.891 rows=21,608 loops=1)

  • Index Cond: (client = '4dd0b1dc-7f25-48b1-a504-849de9c5c75f'::uuid)
9. 0.006 0.015 ↑ 1.0 1 1

Hash (cost=0.52..0.52 rows=1 width=258) (actual time=0.015..0.015 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.009 0.009 ↑ 1.0 1 1

Index Scan using "Clients_pkey1" on "Clients" (cost=0.28..0.52 rows=1 width=258) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (id = '4dd0b1dc-7f25-48b1-a504-849de9c5c75f'::uuid)
11. 518.592 518.592 ↓ 12.0 12 21,608

Index Scan using "Turnovers_endpoint_nomenclatureCode_idx" on "Turnovers" (cost=0.57..0.81 rows=1 width=214) (actual time=0.009..0.024 rows=12 loops=21,608)

  • Index Cond: ((endpoint = '336769b9-a854-483c-b191-c55b7baa37e7'::uuid) AND (("nomenclatureCode")::text = ("Nomenclatures".nomenclature)::text))
12. 778.941 778.941 ↑ 1.0 1 259,647

Index Scan using "Imports_pkey" on "Imports" (cost=0.43..0.58 rows=1 width=24) (actual time=0.002..0.003 rows=1 loops=259,647)

  • Index Cond: (id = "Turnovers".import)
Planning time : 1.922 ms
Execution time : 3,263.387 ms