Re: How to add locale support for each column? - Mailing list pgsql-hackers

From Greg Stark
Subject Re: How to add locale support for each column?
Date
Msg-id 87fz5ej7nn.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: How to add locale support for each column?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hm, ok, setting up a new database with the Conway implementation I see the
time penalty is not "negligible". However it is quite tolerable:

test=> explain analyze select * from test order by a;                                                  QUERY PLAN
                                           
 
----------------------------------------------------------------------------------------------------------------Sort
(cost=69.83..72.33rows=1000 width=32) (actual time=772.175..900.155 rows=206300 loops=1)  Sort Key: a  ->  Seq Scan on
test (cost=0.00..20.00 rows=1000 width=32) (actual time=0.009..203.362 rows=206300 loops=1)Total runtime: 1055.137 ms
 
(4 rows)

test=> explain analyze select * from test order by lower(a);                                                  QUERY
PLAN                                                  
 
----------------------------------------------------------------------------------------------------------------Sort
(cost=72.33..74.83rows=1000 width=32) (actual time=1190.248..1318.607 rows=206300 loops=1)  Sort Key: lower(a)  ->  Seq
Scanon test  (cost=0.00..22.50 rows=1000 width=32) (actual time=0.021..517.679 rows=206300 loops=1)Total runtime:
1565.564ms
 
(4 rows)

test=> explain analyze select * from test order by strxfrm(a,'en_US');
QUERYPLAN                                                    
 
-----------------------------------------------------------------------------------------------------------------Sort
(cost=72.33..74.83rows=1000 width=32) (actual time=2135.535..2263.429 rows=206300 loops=1)  Sort Key: strxfrm(a,
'en_US'::text) ->  Seq Scan on test  (cost=0.00..22.50 rows=1000 width=32) (actual time=0.060..1384.428 rows=206300
loops=1)Totalruntime: 2516.981 ms
 
(4 rows)

test=> explain analyze select * from test order by strxfrm(a,'fr_CA');
QUERY PLAN                                                    
 
------------------------------------------------------------------------------------------------------------------Sort
(cost=72.33..74.83rows=1000 width=32) (actual time=2155.991..2284.054 rows=206300 loops=1)  Sort Key: strxfrm(a,
'fr_CA'::text) ->  Seq Scan on test  (cost=0.00..22.50 rows=1000 width=32) (actual time=18.455..1403.390 rows=206300
loops=1)Totalruntime: 2538.886 ms
 
(4 rows)

-- 
greg



pgsql-hackers by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: How to add locale support for each column?
Next
From: Jan Wieck
Date:
Subject: Re: signal 11 on AIX: 7.4.2