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: 15:28 on 21 Sep 2004
On Tue, Sep 21, 2004 at 11:22:26AM -0400, Jesse Sheidlower wrote:
> 200 queries isn't itself a problem. When there are ten or
> twenty or more people using the database at the same time,
> however, doing queries some of which are computationally or
> I/O intensive, I'd rather not subject it to an extra 199
> queries/user for each request.

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).

> Perhaps I can do the main query all raw, and then use CDBI for
> some of the accessorizing. That had been my goal with using
> set_sql, but I hadn't realized that getting things out would
> be this complicated.

It's only complicated if you want to make it so. You're getting a load
of data back that doesn't map to a single object. So you need to decide
whether to make it be a 'pretend' object (a trivial subclass with some
extra TEMP columns), or whether you want to flesh out all the associated
classes instead. The first is fiarly trivial. The second is more
involved, as you're setting some values to be other objects, but it's
hardly rocket surgery.

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