# explain (analyze,verbose) select customer_id from service order by customer_id;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=64804990.92..65623829.48 rows=327535424 width=4) (actual time=2673682time=487209.054250..3071428546557.236064 rows=327535416 loops=1)
Output: customer_id
Sort Key: service.customer_id
Sort Method: external merge Disk: 4482448kB
-> Seq Scan on public.service (cost=0.00..5045816.24 rows=327535424 width=4) (actual time=0time=2.029705..12933549659.120173 rows=327535416 loops=1)
Output: customer_id
Planning time: 0.178093 ms
Execution time: 3086375554914.395731 ms
(8 rows)
Time: 3086381554919.530649 ms
# explain (analyze,verbose) select customer_id from service order by customer_id;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Index Only Scan using service_customer_id_idx on public.service (cost=0.57..1061141647.19 rows=327535424 width=4) (actual time=0time=2.043753..987310346400.506896 rows=327535416 loops=1)
Output: customer_id
Heap Fetches: 327535416
Planning time: 01.127921 ms
Execution time: 1003076355637.590985 ms
(5 rows)
Time: 1003082355647.344367 ms