Re: Megabytes of stats saved after every connection - Mailing list pgsql-general

From Greg Stark
Subject Re: Megabytes of stats saved after every connection
Date
Msg-id 87y87p7dwn.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Megabytes of stats saved after every connection  (Phil Endecott <spam_from_postgresql_general@chezphil.org>)
Responses Re: Megabytes of stats saved after every connection
List pgsql-general
Phil Endecott <spam_from_postgresql_general@chezphil.org> writes:

> Hello again,
>
> Just to give a bit of background, in case it is useful: this is my family tree
> website, treefic.com.  I have a schema for each user, each with about a dozen
> tables.  In most cases the tables are small, i.e. tens of entries, but the
> users I care about are the ones with tens of thousands of people in their
> trees.  The schemas are independent of each other.  Example web page:

I would strongly suggest you reconsider this design altogether. A normal (and
normalized) design would have a users table that assigns a sequential id to
each user. Then every other table would combine everybody's data but have a
user id column to indicate which user that row belonged to.

If you don't believe there's anything wrong with your current system, consider
what it would look like to query your existing schema to find out the answer
to the question "how many users have > 1000 people in their tree". Or "how
many users have updated their tree in the last 7 days".

In a normalized database you really want one table for any given type of data.
Not hundreds of tables that contain the same type data but for different
people.

--
greg

pgsql-general by date:

Previous
From: "John D. Burger"
Date:
Subject: Re: GUID for postgreSQL
Next
From: Greg Stark
Date:
Subject: Re: GUID for postgreSQL