Re: Whose Fish? RDBMS Solution
- From: Mark Jeffcoat <jeffcoat@xxxxxxxxxxxxxxx>
- Date: Fri, 25 May 2007 14:52:46 -0500
Jordan Marr <jnmarr@xxxxxxxxxxx> writes:
I decided to try this, as an SQL exercise. I took
me a couple of hours to get right, and I'm not entirely
happy with my solution, so I'm going to post the entire
thing. Comments are interspersed, especially where I think
I've done something particularly awkward. I'd appreciate
any suggestions you may have on how to make this solution
cleaner, or even on completely different (yet still legal
SQL) approaches.
Nice job Mark! That is a very creative solution!
How long does it take to process?
Thank you. Good fun.
The whole thing takes about 6 seconds; about half
in disk I/O in the (tiny) CREATE TABLEs at the
beginning, and half in the giant SELECT that finds
the answer.
(Measured on an elderly 2.5GHz Celeron machine running
PostgreSQL. Your mileage may vary.)
From looking at the query plan, if I were asked tooptimize the query, my best strategy is to change
my name and move to another country.
--
Mark Jeffcoat
Austin, TX
.
- Follow-Ups:
- Re: Whose Fish? RDBMS Solution
- From: Gene Wirchenko
- Re: Whose Fish? RDBMS Solution
- References:
- RE: Whose Fish? RDBMS Solution
- From: Jordan Marr
- RE: Whose Fish? RDBMS Solution
- Prev by Date: Re: PostgreSQL or MySQL ?
- Next by Date: Re: Whose Fish?
- Previous by thread: RE: Whose Fish? RDBMS Solution
- Next by thread: Re: Whose Fish? RDBMS Solution
- Index(es):