Mailing List Archive



Back to the month index Back to the list index

rasmus@madhaus.utcs.utoronto.ca
Mon, 2 Sep 1996 06:43:08 -0400 (EDT)


From: rasmus@madhaus.utcs.utoronto.ca
Date: Mon, 2 Sep 1996 06:43:08 -0400 (EDT)
Subject: Re: [PHP] [mSQL] Chat Rooms
Message-Id: <ML-2.3.841660988.9124.rasmus@krone.house.mil>

> One question I do have, being pretty new to UNIX, what is the deal with
> PHP/FI and dbm tables? Would it be better to use dbm tables instead of
> msql, or is it even possible? Remember, I'm not doing any likes or
> wheres or ands or ors, it's simply reading and writing. Opinions: for
> chat, mSQL vs dbm.

A dbm file is just a hash table of key,value entries. Each key must be
unique and that key can then be looked up quickly. This is very similat to
an mSQL table with a primary key field. However, with mSQL, you can have
multiple value fields, and you can use intelligent query parameters.

For your needs, dbm might be useful. Although, I am not so sure it would
improve performance or even cpu load very much. mSQL is a pretty simple
little tool which doesn't put a lot of load on your system as long as your
database remains relatively small.

Are you using a primary key to store each line that people enter? If so,
converting it to use gdbm should be simple. However, I suspect you are
not using a primary key and simply storing each line with a Unix timestamp
and then when you need to refresh, you simply select all entries with a
timestamp greater than a certain value. In this case, a move to gdbm would
be much trickier since you wouldn't be allowed two entries with the same
timestamp. With a lot of people chatting, you would get lots of entries
with the exact same timestamp.

-Rasmus
--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!