Re: optimizing qualifier / query
Re: optimizing qualifier / query
- Subject: Re: optimizing qualifier / query
- From: Chuck Hill <email@hidden>
- Date: Fri, 21 Aug 2009 09:13:27 -0700
On Aug 21, 2009, at 6:46 AM, Jean-Francois Veillette wrote:
I have a text field that have the binding :
value = reclamationDG.queryMatch.agentImmobiliers.agent.nomPrenom;
The user want to filter a display group. The initial object are of
Reclamation class.
The graph is as follow:
Reclamation -->> agentImmobiliers --> Agent . nomPrenom
There are 3 problems with this:
1- Reclamation -->> agentImmobiliers is a to-many
That should not be a problem. It might be with queryMatch (I don't
use that much), but Wonder and Houdah have qualifiers that can work
with this.
2- agentImmobiliers --> Agent is a fake relation, not based on
primary key. It's a method that query based on the latest (based
on the max snapshot date) Agent for an identifier key also kept in
the agentImmobilier object.
Consider adding a currentAgent relationship to point to the one with
the latest date and keep this updated.
3- nomPrenom is a method that return the concatenation of both
firstName and lastName.
Do this in the E0Model using a derived attribute, e.g. the definition
would be firstName || ' ' || lastName. This will be read only and not
kept up to date with changes to the names made in EOF. But you can
than qualify on the database.
The only way I was able to speed it up is to pre-fetch the relation
agentImmobiliers --> Agent. It does work great ... most of the time.
But sometimes, (I guess when eos get too old due to fetch timestamp)
they need to be refreshed and things just start to get bad.
Not sure what you are seeing there.
Do you have any recommandation for me ?
A few.
Ideally I would like to avoid doing the prefetch of agentImmobiliers
--> Agent and have a single query to the db ... one can dream :-)
I think you will have to do that by hand.
Chuck
note:
- WO 5.3 (latest),
- MicrosoftSQL Server,
- reclamation table is juste over 1k big,
- reclamation -->> agentImmobiliers list contain an average of 2 or
3 objects,
some will have more (max 5 I would say), this is not growing,
- agentImmobiliers -->> Agent list (based on the identifier key)
will contain
an average of 30 objects, this will grow as time goes,
- Wonder (latest of the 5.3 branch I think, not updated for a while,
maybe a bit old by now),
- jfv
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden