Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-09 Thread Misa Simic
On Monday, July 8, 2013, Robert James wrote: > On 7/8/13, hubert depesz lubaczewski > > wrote: > > On Mon, Jul 08, 2013 at 09:09:26AM -0400, Robert James wrote: > >> I have two relations, where each relation has two fields, one > >> indicating a name and one indicating a position. That is, each >

Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-09 Thread Darren Duncan
Though people talk about doing this in other languages, I think you can solve it in plain SQL if you wanted to. For one thing, you could start off using unordered set operations to make the problem space smaller, such as using set intersection to see what the common subSETs of values there are

Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-08 Thread Marcin Mańk
Dnia 9 lip 2013 o godz. 00:46 Michael Paquier napisał(a): > On Tue, Jul 9, 2013 at 5:04 AM, Robert James wrote: >> On 7/8/13, hubert depesz lubaczewski wrote: >>> On Mon, Jul 08, 2013 at 09:09:26AM -0400, Robert James wrote: I have two relations, where each relation has two fields, one

Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-08 Thread Michael Paquier
On Tue, Jul 9, 2013 at 5:04 AM, Robert James wrote: > On 7/8/13, hubert depesz lubaczewski wrote: >> On Mon, Jul 08, 2013 at 09:09:26AM -0400, Robert James wrote: >>> I have two relations, where each relation has two fields, one >>> indicating a name and one indicating a position. That is, each

Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-08 Thread Robert James
On 7/8/13, hubert depesz lubaczewski wrote: > On Mon, Jul 08, 2013 at 09:09:26AM -0400, Robert James wrote: >> I have two relations, where each relation has two fields, one >> indicating a name and one indicating a position. That is, each >> relation defines a sequence. >> >> I need to determine

Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-08 Thread hubert depesz lubaczewski
On Mon, Jul 08, 2013 at 09:09:26AM -0400, Robert James wrote: > I have two relations, where each relation has two fields, one > indicating a name and one indicating a position. That is, each > relation defines a sequence. > > I need to determine their longest common subsequence. Yes, I can do >

Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-08 Thread Atri Sharma
On Mon, Jul 8, 2013 at 6:39 PM, Robert James wrote: > I have two relations, where each relation has two fields, one > indicating a name and one indicating a position. That is, each > relation defines a sequence. > > I need to determine their longest common subsequence. Yes, I can do > this by fe

[GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-08 Thread Robert James
I have two relations, where each relation has two fields, one indicating a name and one indicating a position. That is, each relation defines a sequence. I need to determine their longest common subsequence. Yes, I can do this by fetching all the data into Java (or any other language) and comput