[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nss-mysql-devel] getent
From: |
Guillaume Morin |
Subject: |
Re: [Nss-mysql-devel] getent |
Date: |
Tue, 14 May 2002 16:49:36 +0200 |
User-agent: |
Mutt/1.3.28i |
Dans un message du 13 May à 19:33, Jelmer Vernooij écrivait :
> It seems that first, a list with users is retrieved using
> SELECT user.uid FROM user (or alike) and then a query to get the data
> of a single user /for each user/. I have about 2000 people in my MySQL
> table and one can imagine that this slows programs like 'finger' down
> noticably.
>
> Are there any reasons to do SELECT user.uid FROM user and then per
> user queries? In my nss_mysql module, I just do
> 'SELECT user.uid,user.username,user.gecos,user.shell,etc FROM user',
> which seems to work pretty fine (and faster).
That is mainly for historical reasons and to reuse the fill_struct
functions.
You may have notice that we proceed differently with groups, we cache
all data in setgrent. This has been implemented this way because a lot
of apps do frequent getgrents. Of course, it is slow for apps which only
does one.
Implementing what you suggest is a good idea. But that implies a
redesign, fill_struct funtiocs will have to be split to a function which
does the query and one that actually fills the struct.
Thanks for your remarks. Regards,
--
Guillaume Morin <address@hidden>
A friend in need is a friend indeed. A friend who bleeds is better.
My friend confessed, she passed the test. We will never sever.
(Placebo)