forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: kurt on November 15, 2004, 01:44:56 pm
-
I got now ovar 6000 users in my database.
When I click on usermgr.php the script hangs up.
I figured out the this part of the script is to havy for the server:
# $sql = "SELECT user_id, user_name, UNIX_TIMESTAMP(user_regdate) as user_regdate, UNIX_TIMESTAMP(user_lastvisit) as user_lastvisit, user_active, ".
# "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_name, group_quota ".
# "FROM {$CONFIG['TABLE_USERS']} AS u ".
# "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group = group_id ".
# "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.owner_id = u.user_id ".
# "GROUP BY user_id ".
# "ORDER BY " . $sort_codes[$sort] . " ".
# "LIMIT $lower_limit, $user_per_page;";
Any help or update?
-
Can you verify you have an index on user_id on your users table ?
-
user_id is underlined in phpMyAdin. PRIMERY_KEY is user_id.
Hope that is what you wanted to know.
I have changed user_id from INT(11) to bigint(20). Was that the mistake?
-
I dont know, but seems pretty pointless unless you are expecting more than 2 billion users to sign up for your gallery.
Add an index using
ALTER TABLE CPG_pictures ADD INDEX owner_id( `owner_id` );
where CPG_ is your tablename prefix as set on install.
-
--> ALTER TABLE cpg132_pictures ADD INDEX owner_id( `owner_id` )
SQL Error Message: Allready exists 'owern_id'
I change BIGINT(20) back into to INT(11).
But it still hangsup. I think that maybe the SQL statement is wrong, or the result is to big, or it take too much time for this query, so an server time out comes.
-
OK !!! EXCELLENT!!!
I create a new Index over the user_id on *_users
and one over *_pictures on ownerid!!!
Now it runs!
VERY GOOD SUPPORT HERE!!! THANKS A LOT!