Hello pp,
On Monday, December 2, 2002 at 4:40:00 PM you wrote:
p> Very effective and fast for 120,000 articles and 70,000 topics.........
Well, as for now, I have put every record into a separate article and
assigned cell values to those articles' parameters...
Suppose, we have 300 articles with corresponding parameters
representing the following table layout:
table article {
parameter name,
parameter color,
parameter price
}.
I want to supply a query form on a web page that would contain these
parameters as selectable lists of unique values. Should be smth. like
this:
* Choose articles you want to be listed:
Name: <a concrete name> or <all>
Color: <a concrete color> or <all>
Price: <a concrete price> or <all>
Using SQL I'd issue the following queries, to obtain the corresponding list
values:
SELECT distinct name FROM article;
SELECT distinct color FROM article;
SELECT distinct price FROM article;
These queries would be quite fast and I even could apply a desired
ordering using ORDER BY to them...
So, the question arises, how do I implement, in the most efficient
way, the same functionality using Midgard objects instead of DB tables
and corresponding SQL queries...
I guess, I could list all articles for a given topic and fetch all of
them into an array; then I could work with the array of objects,
sorting it on object parameters the way I want using the usort PHP
function... I could cycle through the array and gather the
forementioned lists to fill the select fields with... But, as I've
estimated... it's _too_ slowly even for a topic with just 300 articles
in it. ;(
Any ideas how to do the same task with an improved performance...?
--
See you,
Andrey.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]