[prev in list] [next in list] [prev in thread] [next in thread] 

List:       midgard-dev
Subject:    Re: [midgard-dev] Query Builder and functions like
From:       Piotras <pp () infoglob ! com>
Date:       2005-07-13 12:26:54
Message-ID: 20050713142654.328e8fa2.pp () infoglob ! com
[Download RAW message or body]

Jukka Zitting <jz@yukatan.fi> wrote:

> 
> I think this is a different issue. As far as I understood, your idea was 
> to allow the object storage to be split across multiple tables.

Two behaviours:
1. Make mutliple tables storage 
2. Get properties from multiple tables only when any get method is called.

You need the second one to resolve events and eventsmember issue.
Or implement multiple types usage for QB, which is the same as you need
to generate one querry.  

> Currently the query builder works something like this:
> 
> SELECT id FROM ... WHERE ...;
> for each id
> SELECT ... FROM repligard WHERE realm=... AND id=...;
> SELECT ... FROM <table> WHERE id=...;
> for each external table
> SELECT ... FROM <external table> WHERE ...;
> 
> This certainly isn't good for performance when you've got a result set 
> of more than a dozen objects.
> 
> I'd like to refactor this into:
> 
> SELECT r.<repligard fields>, t.<table fiels>[, eN.<external fields>]+
> FROM repligard AS r, <table> AS t[, <external table> AS eN]+
> WHERE r.realm=... AND r.id=t.id AND ...;

And this was the first implememntation for selects. And we talked about this many \
times. I made performance tests and 1 ( *one* ) article object was retrieved about \
0,80 sec. While three selects ( repligard, article, article_i ) were 0,00 sec. per \
each.

MySQL 4.x cache feature may be very helpfull here as first long one select was about \
0,10 sec  when used more than once in a short time. 

Besides , if you think about update(create)_matching functions you MUST use more than \
one query. I would be more than happy to use only one select for get methods , but I \
do not know if it is possible to  make them fast.

Piotras



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@midgard-project.org
For additional commands, e-mail: dev-help@midgard-project.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic