Re: trees, trees, trees

From: geos <geos_at_nowhere.invalid>
Date: Tue, 26 Jun 2012 00:00:37 +0200
Message-ID: <jsan40$8kj$1_at_news.task.gda.pl>



ddf wrote:
> Can you, and have you tried since posting this originally?
>
> David Fitzjarrell

ok, here is my solution. as I said, it works on the client data, it works on the data provided here as an example, but I'm no 100% sure if this is correct approach and doesn't have any flaws. I would appreciate if you spot such flaws or share some data for which it doesn't work so that I could analyze it and improve the code.

you can see some xml usage. this is because I found it has better performance in 11g than "level dual splitting comma separated string into rows in oracle" approach.

what I really don't like in this code is its overbloated replace/regexp_replace section (it's ugly!). I am not good at this, and basically I wanted to have a pattern which finds the longest concecutive repetetive substring in a string. for example:

1,2,2,4: 2 is the longest, it repeats twice 1,2,3,2,3,2,3,4: 2,3 is the longest, it repeats three times

or -- better! -- to replace any duplicate substrings with its one instance.

please treat this code as beta-code, an entry point for any discussion (about it ;) ). I would appreciate any performance improvments hints, suggestions or ideas from people who have more in depth theoretical/practical insight in the subject.

http://geos2005.republika.pl/betacode.sql

please share some ideas concepts thoughts about it.

thank you,
geos Received on Mon Jun 25 2012 - 17:00:37 CDT

Original text of this message