|
Posted by Michael Fesser on 11/23/06 23:20
..oO(Sandman)
>In article <4565b82b$0$325$e4fe514c@news.xs4all.nl>,
> Erwin Moller
> <since_humans_read_this_I_am_spammed_too_much@spamyourself.com>
> wrote:
>
>> First: Prefetching all members into memory for each page where you need one
>> or two members is absolutely a no-go. You must change that of course.
>> Just fetch the information you need WHEN you need it.
>
>Yes, but if I need to fetch information for 100 members on one page
>making 100 individual SQL queries is also a no-go.
If you have to show informations about 100 members on a page then your
script should already know which members that are. If you want to show
some blog articles then you know who wrote them, so you can fetch all
the member informations with a single query, maybe even together with
the blog articles.
>[...] But that's not very intelligent either,
>since a SQL query with "select x, x, x from member where id in(<list
>of 100's of ids>)" isn't very good.
What's wrong with that?
>So, basically, I need a function to get information about user X from
>a member count of tens of thousands while not being time consuming if
>I do it one time on a page or if I do it 100 times on a page.
Is your database indexed properly? A database with some ten thousand
entries is peanuts. It shouldn't take much time to fetch a hundred
records from it.
Micha
Navigation:
[Reply to this message]
|