Re: [SQL] EXTERNAL storage and substring on long strings

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Scott Cain <cain(at)cshl(dot)org>, PgSQL Performance ML <pgsql-performance(at)postgresql(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] EXTERNAL storage and substring on long strings
Date: 2003-08-14 15:02:53
Message-ID: 3F3BA49D.9070405@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-sql

Tom Lane wrote:
> Scott Cain <cain(at)cshl(dot)org> writes:
>> At least this appears to work and is much faster, completing substring
>> operations like above in about 0.27 secs (that's about two orders of
>> magnitude improvement!)
>
> I find it really, really hard to believe that a crude reimplementation
> in plpgsql of the TOAST concept could beat the built-in implementation
> at all, let alone beat it by two orders of magnitude.
>
> Either there's something unrealistic about your testing of the
> dna_string function, or your original tests are not causing TOAST to be
> invoked in the expected way, or there's a bug we need to fix. I'd
> really like to see some profiling of the poor-performing
> external-storage case, so we can figure out what's going on.

Doesn't look that unrealistic to me. A plain text based substring
function will reassemble the whole beast first before cutting out the
wanted part. His manually chunked version will read only those chunks
needed. Considering that he's talking about retrieving a few thousand
chars from a hundreds of MB size string ...

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-08-14 15:18:42 Re: 7.4 beta 1 getting out of swap
Previous Message Christopher Browne 2003-08-14 14:57:33 Re: Perfomance Tuning

Browse pgsql-sql by date

  From Date Subject
Next Message Christoph Haller 2003-08-14 15:18:03 Re: Changing data type must recreate all views?
Previous Message Slawek Jarosz 2003-08-14 14:40:02 Optional join