coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 modpack by Stramm => Topic started by: giorgio79 on January 20, 2007, 05:27:01 AM

Title: buddy table
Post by: giorgio79 on January 20, 2007, 05:27:01 AM
Hello,

I was just checking out the buddy table structure, and as I understand, there is a new row for every connection...

Would this slow down querying for a larger site with thousand of users, and tens of thousands of connections?

What do you think? Any experience with this?

Thanks,

Gyuri
Title: Re: buddy table
Post by: Stramm on January 22, 2007, 09:19:07 AM
There's an index on the user id... so the search for all buddies of a certain user is pretty fast. A search for only one id of course would be faster. However with the actual system further preparation of the data is not necessary. No preg_match or ereg, no sorting of arrays, no joining data together to a string etc. I have a database to let do it the database stuff.

Of course you can rewrite the code and do the necessary data preparation. If it works fast and stable it's no problem to replace the existing code with yours.
Title: Re: buddy table
Post by: giorgio79 on January 22, 2007, 01:33:30 PM
Cheers Stramm!

Thanks for the kind explanation.

I broke up my questions on this topic to two threads to meet the one question per topic :) Hope this was OK.

I was checking out the code and there are only a few queries on the buddy table so I might rewrite those select statements as I have a networking site with a member table that has ids stored for a member in one field :)
Title: Re: buddy table
Post by: giorgio79 on January 22, 2007, 03:35:12 PM
Stramm, just one more question. if I would rewrite some of these queries, can I use the API for the Modpack as well?

I have read that it is not a good idea to change the core code...

Cheers,

Gyuri
Title: Re: buddy table
Post by: Stramm on January 22, 2007, 03:47:01 PM
Honestly, I do not know cause I never used the api... just try. But nothing would come to my mind that'll stop it from working