[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nss-mysql-devel] [ 101504 ] id command VERY slow
From: |
nobody |
Subject: |
[Nss-mysql-devel] [ 101504 ] id command VERY slow |
Date: |
Thu, 07 Nov 2002 16:26:35 -0500 |
Support Request #101504, was updated on 2002-Nov-07 16:26
You can respond by visiting:
http://savannah.nongnu.org/support/?func=detailsupport&support_id=101504&group_id=443
Category: None
Status: Open
Priority: 5
Summary: id command VERY slow
By: marcus
Date: 2002-Nov-07 16:26
Logged In: NO
Browser: Mozilla/4.0 (compatible; MSIE 5.15; Mac_PowerPC)
Hi
I am running nss-mysql 0.43 on a redhat linux 7.2
machine and the 'id' command is incredibly slow.
By turning on mysql logging I have found that it is
doing loads of unnecessary group queries.
For example, if I type 'id server' (server is a valid
username), the following query is used...
select users.username,users.userId +
2000,NULL,users.realName,users.shell,users.ho
meDir,users.groupId + 2000 from users where
users.username='server' and users.userId + 2000
is not null and users.status = 'A' order by
users.userId + 2000
..which return the user details very quickly. This is
then followed by...
select users.username,users.userId +
2000,NULL,users.realName,users.shell,users.ho
meDir,users.groupId + 2000 from users where
users.userId + 2000=7432 and users.status = 'A'
order by users.userId + 2000
..which returns the same information. Then, the
following query is made over 200 times...
select groups.groupName,groups.groupId +
2000,groups.groupPassword,users.username
from groups LEFT JOIN usersGroups on
groups.groupId=usersGroups.groupId LEFT JOIN
users on usersGroups.userId=users.userId and
users.status = 'A' where groups.groupId + 2000 =
2001 and groups.status = 'A'
...which returns every single user in the group.
Also, I built the system to use just one group for all
16,000+ users because of the earlier issue with
having large numbers of groups. So, with so many
rows returned in each of the above queries, it takes
1min 13secs to complete!
Ideally, could it use a query something like this?...
select users.*, groups.* from users, usersGroups,
groups where users.username='server' and
usersGroups.userId=users.userId and
groups.groupId=usersGroups.groupId
This works instantly.
Thanks in advance.
Marcus
----------------------------------------------------------------------
You can respond by visiting:
http://savannah.nongnu.org/support/?func=detailsupport&support_id=101504&group_id=443
- [Nss-mysql-devel] [ 101504 ] id command VERY slow,
nobody <=