Optimising FormBuilder database access for linked fields
| From: | Anselm Heaton | Date: | Wed, 08 Feb 2006 13:26:14 +0000 |
| Subject: | Optimising FormBuilder database access for linked fields | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22854@lists.php.net to get a copy of this message | ||
Hello,
When a table is used as a linked field in FormBuilder, the values of interest
are those describied in the linkDisplayFields for that table, and the primary
key.
However, FormBuilder queries all of the object's fields when creating the form
(I assume it calls DB_DataObject::find and ::fetch which will query all the
fields). At times this can add a certain overhead to the execution time !
Does anyone know of a way to get FormBuilder to only query the
linkDisplayFields when used as a linked table ?
Of course, I could always split my linked table in two (so that one table
contains only the linkDisplayFields and the primary key, with the rest of the
data in another table), however this feels a bit heavy just to optimise
database calls ! (and it wouldn't be normal form). Getting the code to do it
sounds much more sensible !
Thank you,
Anselm
--
------------------------------
Netuxo Ltd
a workers' co-operative
providing low-cost IT solutions
for peace, environmental and social justice groups
and the radical NGO sector
Registered as a company in England and Wales. No 4798478
Registered office: 5 Caledonian Road, London N1 9DY, Britain
------------------------------
email office@netuxo.co.uk
http://www.netuxo.co.uk
------------------------------