Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news-FFM2.ecrc.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer00.lnd.ops.eu.uu.net!lnewsinpeer00.lnd.ops.eu.uu.net!bnewsoutpeer00.bru.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!not-for-mail
From: "Niall Litchfield" <n-litchfield@audit-commission.gov.uk>
Newsgroups: comp.databases.oracle.server
References: <1075188942.399322@yasure> <bv97ag$gip$1@news3.tilbu1.nb.home.nl> <1075338777.438703@yasure> <pX_Rb.176163$xy6.832255@attbi_s02> <S7%Rb.172995$I06.1737861@attbi_s01> <1075354128.934744@yasure> <jp6Sb.175825$I06.1770316@attbi_s01> <1075392160.811682@yasure> <bvdo31$7b0$1@cronkite.cc.uga.edu> <1075478670.131740@yasure> <1075682270.753428@yasure>
Subject: Re: Oracle For Fun
Date: Mon, 2 Feb 2004 10:13:51 -0000
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Lines: 41
Message-ID: <401e22e0$0$9393$ed9e5944@reading.news.pipex.net>
NNTP-Posting-Date: 02 Feb 2004 10:13:52 GMT
NNTP-Posting-Host: host9.audit-commission.gov.uk
X-Trace: 1075716832 reading.news.pipex.net 9393 193.128.236.219:13852
X-Complaints-To: abuse@uk.uu.net
Xref: newssvr20.news.prodigy.com comp.databases.oracle.server:253445

"Daniel Morgan" <damorgan@x.washington.edu> wrote in message
news:1075682270.753428@yasure...
>
> As promised I have performed the testing:
>
> The contestants and results can be found at:
> http://www.psoug.org/sql_fun.html
>
> One lesson comes through very clearly from the results ... test, test,
> test. Don't be too quick to think you know what's best just by looking
> at the code you've written.
>
> And never was that more obvious than with this example.

<sour grapes>
I claim goalpost moving, we started with create a function in less than 8
lines of code, and now you gratuitously decide it has to perform well as
well :(
</sour grapes>

I'd add at least one thing to your conclusions.

Sometimes you have to consider readability and maintainability of code as a
trade off to performance.

It looks to me as though the 'traditional' approach might well perform best
even if you add further optional tests, different locales etc, but that the
worst performing solutions may still be readable and understandable. For
example you could extend the regexp solutions to multiple locales by having
a 2 column lookup table with valid regexps for different locales. This would
still be pretty readable, but I suspect the 'traditional' approach would
start to look horrid. Errm the performance of my solution is still utter
cr*p though...


-- 
Niall Litchfield
Oracle DBA
Audit Commission UK


