X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 45014D1C943 for ; Thu, 14 Aug 2003 15:04:23 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 46387-05 for ; Thu, 14 Aug 2003 12:02:43 -0300 (ADT) Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by svr1.postgresql.org (Postfix) with SMTP id DA744D1C4F1 for ; Thu, 14 Aug 2003 12:04:11 -0300 (ADT) Received: from pcp01341166pcs.wilog301.pa.comcast.net (HELO europa.janwieck.net) (janwieck@68.80.245.191 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 14 Aug 2003 15:04:10 -0000 Received: from Yahoo.com (ismtp.afilias.com [216.217.55.254]) (authenticated) by europa.janwieck.net (8.11.6/8.11.6) with ESMTP id h7EF49H14055; Thu, 14 Aug 2003 11:04:12 -0400 Message-ID: <3F3BA49D.9070405@Yahoo.com> Date: Thu, 14 Aug 2003 11:02:53 -0400 From: Jan Wieck Organization: Unorganized User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Scott Cain , PgSQL Performance ML , pgsql-sql@postgresql.org Subject: Re: [SQL] EXTERNAL storage and substring on long strings References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> In-Reply-To: <3574.1060012423@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/261 X-Sequence-Number: 3077 Tom Lane wrote: > Scott Cain 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@Yahoo.com #