pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedSize and performance hit from using UTF8 vs. ASCII?
2+ messages / 2 participants
[nested] [flat]
* Size and performance hit from using UTF8 vs. ASCII?
@ 2006-02-08 14:11 Ron <rjpeace@earthlink.net>
2006-02-08 15:54 ` Re: Size and performance hit from using UTF8 vs. ASCII? Jeffrey W. Baker <jwbaker@acm.org>
0 siblings, 1 reply; 2+ messages in thread
From: Ron @ 2006-02-08 14:11 UTC (permalink / raw)
To: pgsql-performance
I'm specifically interested in the default C Locale; but if there's a
difference in the answer for other locales, I'd like to hear about
that as well.
Thanks in Advance,
Ron
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Size and performance hit from using UTF8 vs. ASCII?
2006-02-08 14:11 Size and performance hit from using UTF8 vs. ASCII? Ron <rjpeace@earthlink.net>
@ 2006-02-08 15:54 ` Jeffrey W. Baker <jwbaker@acm.org>
0 siblings, 0 replies; 2+ messages in thread
From: Jeffrey W. Baker @ 2006-02-08 15:54 UTC (permalink / raw)
To: Ron <rjpeace@earthlink.net>; +Cc: pgsql-performance
On Wed, 2006-02-08 at 09:11 -0500, Ron wrote:
> I'm specifically interested in the default C Locale; but if there's a
> difference in the answer for other locales, I'd like to hear about
> that as well.
The size hit will be effectively zero if your data is mainly of the
ASCII variety, since ASCII printable characters to UTF-8 is an identity
transform. However anything involving string comparisons, including
equality, similarity (LIKE, regular expressions), or any other kind of
comparison (ORDER BY, GROUP BY) will be slower. In my experience the
performance hit varies from zero to 100% in CPU time. UTF-8 is never
faster that ASCII, as far as I know.
However, if you need UTF-8 then you need it, and there's no point in
worrying about the performance hit.
You may as well just do two benchmark runs with your database
initialized in either character set to see for yourself.
-jwb
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-02-08 15:54 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-08 14:11 Size and performance hit from using UTF8 vs. ASCII? Ron <rjpeace@earthlink.net>
2006-02-08 15:54 ` Jeffrey W. Baker <jwbaker@acm.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox