[MUD-Dev] Database vs. Disk

Byron Ellacott bje at apnic.net
Mon May 19 14:30:37 CEST 2003


On Sun, 2003-05-18 at 01:03, Tom wrote:

> We're considering moving to database because it'd provide us alot
> of extra versatility, but I'd like some informed opinions. Not so
> much whether a SQL database would be more efficient, but would it
> be drastically inefficient on a MUD with a large number of objects
> (500,000 to 2,000,000)?

That depends on how you're accessing those objects.  If you're doing
a simple "select * from table where key = value" then an RDBMS that
has good indexing capabilities will be fairly efficient, speedwise.
It may take up a chunk of disk space to provide that indexing,
though, especially if the key is not a simple numeric type.

For some sort of idea, here's a database I work with regularly,
names changed to protect the innocent:

  mysql> select count(*) from TableName;
  |  1401460 |
  1 row in set (0.00 sec)

  mysql> select * from TableName where id = 1;
  ...
  1 row in set (0.04 sec)

  mysql> select * from TableName where id = 1401460;
  ...
  1 row in set (0.00 sec)

Randomly selecting ids, I couldn't get access time above 0.05
seconds. The contents of a single row from that table aren't very
big, though -- if you've got a lot of data in the row, you might be
facing a bit of overhead interpreting the results.

The machine is a dual CPU pIII, 1.7GHz I believe, with 1Gb of RAM.
The database is operating off a single IDE disk, with no care as to
where on the platter the data lives.  The mySQL server isn't
particularly highly tuned for performance, either.  Your mileage may
vary.

--
bje

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list