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 A4A4DD1C9DB; Mon, 4 Aug 2003 15:53:57 +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 24438-06; Mon, 4 Aug 2003 12:52:40 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B4BABD1C9ED; Mon, 4 Aug 2003 12:53:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h74FrhSa003575; Mon, 4 Aug 2003 11:53:44 -0400 (EDT) To: Scott Cain Cc: PgSQL Performance ML , pgsql-sql@postgresql.org Subject: Re: [SQL] EXTERNAL storage and substring on long strings In-reply-to: <1060010735.1433.26.camel@localhost.localdomain> References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> Comments: In-reply-to Scott Cain message dated "04 Aug 2003 11:25:36 -0400" Date: Mon, 04 Aug 2003 11:53:43 -0400 Message-ID: <3574.1060012423@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/33 X-Sequence-Number: 2850 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. regards, tom lane