explain.depesz.com

PostgreSQL's explain analyze made readable

Result: euEe : Optimization for: Optimization for: plan #ZNyR; plan #QKQB

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.009 23.468 ↑ 4.0 1 1

Sort (cost=304.86..304.87 rows=4 width=162) (actual time=23.468..23.468 rows=1 loops=1)

  • Sort Key: woa.archive_date DESC, woa.id DESC, wola.sort_order
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10,158
2. 0.003 23.459 ↑ 4.0 1 1

Nested Loop Left Join (cost=0.00..304.82 rows=4 width=162) (actual time=15.798..23.459 rows=1 loops=1)

  • Buffers: shared hit=10,158
3. 0.162 23.413 ↑ 4.0 1 1

Nested Loop (cost=0.00..238.78 rows=4 width=149) (actual time=15.753..23.413 rows=1 loops=1)

  • Buffers: shared hit=10,146
4. 0.130 5.251 ↓ 111.1 1,000 1

Append (cost=0.00..44.47 rows=9 width=78) (actual time=1.022..5.251 rows=1,000 loops=1)

  • Buffers: shared hit=130
5. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on gms_workorder_line_archive wola (cost=0.00..0.00 rows=1 width=148) (actual time=0.002..0.002 rows=0 loops=1)

  • Filter: ((is_placeholder IS FALSE) AND (company_uuid = '11111111-0000-0000-0000-000000000000'::uuid) AND ('b'::text <% ((COALESCE(code_custom, ''::text) || ' '::text) || COALESCE(description_custom, ''::text))))
6. 0.806 0.806 ↓ 0.0 0 1

Seq Scan on gms_workorder_line_invoice wola_1 (cost=0.00..11.00 rows=1 width=66) (actual time=0.806..0.806 rows=0 loops=1)

  • Filter: ((is_placeholder IS FALSE) AND (company_uuid = '11111111-0000-0000-0000-000000000000'::uuid) AND ('b'::text <% ((COALESCE(code_custom, ''::text) || ' '::text) || COALESCE(description_custom, ''::text))))
  • Rows Removed by Filter: 100
  • Buffers: shared hit=9
7. 0.061 0.061 ↓ 0.0 0 1

Index Scan using gms_workorder_line_portal_archive_pkey on gms_workorder_line_portal_archive wola_2 (cost=0.14..8.17 rows=1 width=148) (actual time=0.061..0.061 rows=0 loops=1)

  • Index Cond: (company_uuid = '11111111-0000-0000-0000-000000000000'::uuid)
  • Filter: ((is_placeholder IS FALSE) AND ('b'::text <% ((COALESCE(code_custom, ''::text) || ' '::text) || COALESCE(description_custom, ''::text))))
  • Rows Removed by Filter: 10
  • Buffers: shared hit=2
8. 4.118 4.252 ↓ 166.7 1,000 1

Bitmap Heap Scan on gms_workorder_line_external_archive wola_3 (cost=4.19..25.26 rows=6 width=57) (actual time=0.152..4.252 rows=1,000 loops=1)

  • Recheck Cond: ('b'::text <% ((COALESCE(code_custom, ''::text) || ' '::text) || COALESCE(description_custom, ''::text)))
  • Filter: ((is_placeholder IS FALSE) AND (company_uuid = '11111111-0000-0000-0000-000000000000'::uuid))
  • Heap Blocks: exact=104
  • Buffers: shared hit=119
9. 0.134 0.134 ↓ 166.7 1,000 1

Bitmap Index Scan on idx_gms_workorder_line_archive_line_code_description (cost=0.00..4.19 rows=6 width=0) (actual time=0.134..0.134 rows=1,000 loops=1)

  • Index Cond: ('b'::text <% ((COALESCE(code_custom, ''::text) || ' '::text) || COALESCE(description_custom, ''::text)))
  • Buffers: shared hit=15
10. 3.000 18.000 ↓ 0.0 0 1,000

Append (cost=0.00..21.55 rows=4 width=87) (actual time=0.018..0.018 rows=0 loops=1,000)

  • Buffers: shared hit=10,016
11. 0.000 0.000 ↓ 0.0 0 1,000

Seq Scan on gms_workorder_archive woa (cost=0.00..0.00 rows=1 width=100) (actual time=0.000..0.000 rows=0 loops=1,000)

  • Filter: ((company_uuid = '11111111-0000-0000-0000-000000000000'::uuid) AND (vehicle_uuid = 'f0c6d48d-ea2c-4882-be85-f422e0d056fa'::uuid) AND (wola.archive_uuid = archive_uuid))
12. 11.000 11.000 ↓ 0.0 0 1,000

Seq Scan on gms_workorder_invoice woa_1 (cost=0.00..5.51 rows=1 width=64) (actual time=0.011..0.011 rows=0 loops=1,000)

  • Filter: ((company_uuid = '11111111-0000-0000-0000-000000000000'::uuid) AND (vehicle_uuid = 'f0c6d48d-ea2c-4882-be85-f422e0d056fa'::uuid) AND (wola.archive_uuid = archive_uuid))
  • Rows Removed by Filter: 31
  • Buffers: shared hit=5,000
13. 2.000 2.000 ↓ 0.0 0 1,000

Index Scan using gms_workorder_portal_archive_pkey on gms_workorder_portal_archive woa_2 (cost=0.14..8.17 rows=1 width=100) (actual time=0.002..0.002 rows=0 loops=1,000)

  • Index Cond: (company_uuid = '11111111-0000-0000-0000-000000000000'::uuid)
  • Filter: ((vehicle_uuid = 'f0c6d48d-ea2c-4882-be85-f422e0d056fa'::uuid) AND (wola.archive_uuid = archive_uuid))
  • Rows Removed by Filter: 3
  • Buffers: shared hit=2,000
14. 2.000 2.000 ↓ 0.0 0 1,000

Index Scan using gms_workorder_external_archive_pkey on gms_workorder_external_archive woa_3 (cost=0.28..7.86 rows=1 width=85) (actual time=0.002..0.002 rows=0 loops=1,000)

  • Index Cond: ((company_uuid = '11111111-0000-0000-0000-000000000000'::uuid) AND (archive_uuid = wola.archive_uuid))
  • Filter: (vehicle_uuid = 'f0c6d48d-ea2c-4882-be85-f422e0d056fa'::uuid)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=3,016
15. 0.002 0.043 ↑ 3.0 1 1

Append (cost=0.00..16.48 rows=3 width=61) (actual time=0.042..0.043 rows=1 loops=1)

  • Buffers: shared hit=12
16. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on gms_vehicle_archive v (cost=0.00..0.00 rows=1 width=68) (actual time=0.002..0.002 rows=0 loops=1)

  • Filter: ((company_uuid = '11111111-0000-0000-0000-000000000000'::uuid) AND (uuid = 'f0c6d48d-ea2c-4882-be85-f422e0d056fa'::uuid) AND (woa.vehicle_uuid = uuid) AND (woa.archive_uuid = archive_uuid))
17. 0.028 0.028 ↓ 0.0 0 1

Index Scan using gms_vehicle_invoice_unique_inventory_vehicle_transaction on gms_vehicle_invoice v_1 (cost=0.14..8.16 rows=1 width=68) (actual time=0.028..0.028 rows=0 loops=1)

  • Index Cond: (company_uuid = '11111111-0000-0000-0000-000000000000'::uuid)
  • Filter: ((uuid = 'f0c6d48d-ea2c-4882-be85-f422e0d056fa'::uuid) AND (woa.vehicle_uuid = uuid) AND (woa.archive_uuid = archive_uuid))
  • Rows Removed by Filter: 21
  • Buffers: shared hit=9
18. 0.011 0.011 ↑ 1.0 1 1

Index Scan using gms_vehicle_external_archive_pkey on gms_vehicle_external_archive v_2 (cost=0.28..8.30 rows=1 width=47) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: ((company_uuid = '11111111-0000-0000-0000-000000000000'::uuid) AND (woa.archive_uuid = archive_uuid))
  • Filter: ((uuid = 'f0c6d48d-ea2c-4882-be85-f422e0d056fa'::uuid) AND (woa.vehicle_uuid = uuid))
  • Buffers: shared hit=3
Planning time : 1.237 ms
Execution time : 23.705 ms