Re: Selecting (and accessing) from many tables

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

From: Tony Bowden
Subject: Re: Selecting (and accessing) from many tables
Date: 07:04 on 21 Sep 2004
On Mon, Sep 20, 2004 at 06:55:16PM -0400, Jesse Sheidlower wrote:
> I had thought that I was doing something that would _reduce_
> the overall complexity; if I have to write up new subclasses
> or a variety of custom accessors, it might not be worth it to
> use CDBI at all, for this part of the job.

I'm curious as to why you thought this would reduce complexity.

For a track you wanted to print:

  Track Track.title is on album CD.title by Artist.name
  released in CD.year.

That's just:

my $track = Track->retrieve($id);
printf "Track %s is on album %s by %s released in %d.\n", 
  $track->title, $track->cd->title, 
  $track->cd->artist->title, $track->cd->year;

I'm really not sure what complexity you're trying to reduce here.
I thought you were doing this purely for performance reasons. (Not that
in general there should be performance problems with this approach if
you've got the correct indexes anyway).

Multi-table joins are always, almost by definition, going to be more
complex than simple selects. Especially if you're going to have to
somehow create a family of related objects from the results.

Tony


(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