Rating results after relevance. Difficult problem
| From: | andy | Date: | Wed, 08 May 2002 18:50:48 +0000 |
| Subject: | Rating results after relevance. Difficult problem | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-db+get-19053@lists.php.net to get a copy of this message | ||
Hi there:
I am working on a member search engine. Regarding on the criterias a user
provides (like should speek english, should be interested in arts...) the
machine querries the db and returns the results. But I would like to rate
the results. So All criterias fitt... 100%, Just 1 of 3 -> 33 % and so on.
I did already finish my coding and works fine for a user amount of 20. But
now I generated 2000 random users and woww!!! Take about 2 minitues to
querry!!
So there has to be a better way, right?
What I am doing with this version, is to get all the users fitting the
criteria. Opening a temporary table store the id and the amount of fitting
criterias in it. Retriving this temporary table and sort it after the most
wanted user (100% max).
The problem with this, is that on user takes about 0.04 s to check and store
in the temp table. If there are 2000 users fitting at least one of the
criterias thats 2000 * 0.04 s means 400 s = lots of time! Not to imagine
what happens if there are 100.000 users in the db!!!
So the querry performance is ok, I just need to find a more effective way to
rate them. There are 3 tables.
- user table with most of the data
- language table, containing the languages the user speak (by the time of
registering they can select up to 3 languages)
- interest table, containing the interests of the users (by the time of
registering they can select up to 20 interests)
Can anybody help on that difficult topic? I would really apreciate any hint
on that.
Thanx in advance,
Andy