Re: DB Design of GMail: Multiple tables vs. one table?

From: Larry Coon <lcnospam_at_assist.org>
Date: Tue, 05 Apr 2005 09:55:34 -0700
Message-ID: <4252C306.3354_at_assist.org>


joeserel_at_gmail.com wrote:

> Which one is better? From what I gather, probably one table is better
> to manage - but will that cause performance problem?

You're asking a question which is highly context specific, but in general, it's probably a good rule of thumb that using large numbers of homomorphic tables will not be an optimal solution. A modern dbms will be optimized to deal with large amounts of data in few tables -- we have several tables with tens of millions of rows -- but a dbms may not necessarily be optimized to deal with the overhead of maintaining large numbers of tables as you're proposing.

> Say if this is a
> web mail system, whenever a user login and access Inbox, you'll have to
> load first page of emails from that 10-million-row table. Will the
> performance be hurt even with proper indexing?

As others have said, it depends on the nature of the data and your access patterns. There's nothing inherently bad in the ten million row table, so it sounds like you're trying to optimize around a problem that may not even exist. There are several quotes about the evils of premature optimization that come to mind.  

Larry Coon
University of California Received on Tue Apr 05 2005 - 18:55:34 CEST

Original text of this message