Re: Selecting (and accessing) from many tables

[prev] [thread] [next] [Date index for 2004/09/21]

From: Perrin Harkins
Subject: Re: Selecting (and accessing) from many tables
Date: 16:08 on 21 Sep 2004
On Tue, 2004-09-21 at 11:28, Tony Bowden wrote:
> This still sounds like premature optimisation to me. Most databases are
> really very efficient at this sort of thing (a single row select on a
> primary or foreign key).

While I understand what you and Carl are saying, and people often do
optimize before they should, Jesse is quite correct that 200 small
queries is nearly always slower than one large and correctly written
query.  He even has the large query already.  He's just trying to figure
out if he can use his Class::DBI objects to handle the data shuffling
once he has it from the database, rather than building a complex data
structure himself.

My answer is that unless you are happy with fetching a list of tracks
using a complex query and then letting them do additional queries for
the related CDs and Artists, Class::DBI is not any easier for this than
just building your own structure.  It may be worth investigating how
Hibernate or some other tools handle this scenario to see if there's
anything more that could be done.

- Perrin

(message missing)

Selecting (and accessing) from many tables
Jesse Sheidlower 00:46 on 20 Sep 2004

Re: Selecting (and accessing) from many tables
Tony Bowden 07:18 on 20 Sep 2004

Re: Selecting (and accessing) from many tables
Jesse Sheidlower 12:05 on 20 Sep 2004

Re: Selecting (and accessing) from many tables
Tony Bowden 16:47 on 20 Sep 2004

Re: Selecting (and accessing) from many tables
Jesse Sheidlower 22:55 on 20 Sep 2004

Re: Selecting (and accessing) from many tables
Tony Bowden 07:04 on 21 Sep 2004

Re: Selecting (and accessing) from many tables
Perrin Harkins 19:29 on 20 Sep 2004

Re: Selecting (and accessing) from many tables
Jesse Sheidlower 13:28 on 21 Sep 2004

Re: Selecting (and accessing) from many tables
Tony Bowden 13:56 on 21 Sep 2004

Re: Selecting (and accessing) from many tables
Jesse Sheidlower 14:05 on 21 Sep 2004

Re: Selecting (and accessing) from many tables
Tony Bowden 15:08 on 21 Sep 2004

Re: Selecting (and accessing) from many tables
Jesse Sheidlower 15:22 on 21 Sep 2004

Re: Selecting (and accessing) from many tables
Tony Bowden 15:28 on 21 Sep 2004

RE: Selecting (and accessing) from many tables
Carl Johnstone 15:42 on 21 Sep 2004

Re: Selecting (and accessing) from many tables
Perrin Harkins 16:08 on 21 Sep 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52