Re: TOAST usage setting

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: TOAST usage setting
Date: 2007-05-29 17:19:07
Message-ID: 200705291719.l4THJ7n15790@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark wrote:
> "Bruce Momjian" <bruce(at)momjian(dot)us> writes:
>
> >> No, we did substring() too :)
> >
> > Uh, I looked at text_substring(), and while there is an optimization to
> > do character counting for encoding length == 1, it is still accessing
> > the data.
>
> Sure but it'll only access the first chunk. There are two chunks in your test.
> It might be interesting to run tests accessing 0 (length()), 1 (substr()), and
> 2 chunks (hashtext()).
>
> Or if you're concerned with the cpu cost of hashtext you could calculate the
> precise two bytes you need to access with substr to force it to load both
> chunks. But I think the real cost of unnecessary toasting is the random disk
> i/o so the cpu cost is of secondary interest.

OK, will run a test with hashtext(). What I am seeing now is a 10-20x
slowdown to access the TOAST data, and a 0-1x speedup for accessing the
non-TOAST data when the rows are long:

http://momjian.us/expire/TOAST/

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ed L. 2007-05-29 17:19:55 Re: query log corrupted-looking entries
Previous Message Gregory Stark 2007-05-29 17:06:47 Re: TOAST usage setting