RE: [PHP] Rating results after relevance. Difficult problem
| From: | Jay Blanchard | Date: | Wed, 08 May 2002 18:54:23 +0000 |
| Subject: | RE: [PHP] Rating results after relevance. Difficult problem | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-19055@lists.php.net to get a copy of this message | ||
[snip]
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!!
[/snip]
Are you indexing the tables?
[snip]
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!!!
[/snip]
2000 * 0.04 is 80 seconds, still along time.
[snip]
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)
[/snip]
Indexing the tables may help.
Jay