pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
partitions versus databases
3+ messages / 3 participants
[nested] [flat]

* partitions versus databases
@ 2011-12-08 14:26 chester c young <chestercyoung@yahoo.com>
  2011-12-09 01:13 ` Re: partitions versus databases Craig Ringer <ringerc@ringerc.id.au>
  2011-12-10 22:42 ` Re: partitions versus databases Jasen Betts <jasen@xnet.co.nz>
  0 siblings, 2 replies; 3+ messages in thread

From: chester c young @ 2011-12-08 14:26 UTC (permalink / raw)
  To: pgsql-sql

have an db with about 15 tables that will handle many companies.  no data overlap between companies.  is it more efficient run-time to use one database and index each row by company id, and one database and partition each table by company id, or to create a database for each company?

it is a web-based app using persistent connections.  no copying.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: partitions versus databases
  2011-12-08 14:26 partitions versus databases chester c young <chestercyoung@yahoo.com>
@ 2011-12-09 01:13 ` Craig Ringer <ringerc@ringerc.id.au>
  1 sibling, 0 replies; 3+ messages in thread

From: Craig Ringer @ 2011-12-09 01:13 UTC (permalink / raw)
  To: chester c young <chestercyoung@yahoo.com>; +Cc: pgsql-sql

On 12/08/2011 10:26 PM, chester c young wrote:
> have an db with about 15 tables that will handle many companies.  no data overlap between companies.  is it more efficient run-time to use one database and index each row by company id, and one database and partition each table by company id, or to create a database for each company?
>
> it is a web-based app using persistent connections.  no copying.
>

If you post a question on Stack Overflow and on the mailing list, please 
link to your stack overflow question from your mailing list post!

http://stackoverflow.com/questions/8432636/in-postgresql-are-partitions-or-multiple-databases-more-e...

That'll help avoid duplication of effort, and make it easier for people 
searching for similar topics later to find out more.

--
Craig Ringer

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: partitions versus databases
  2011-12-08 14:26 partitions versus databases chester c young <chestercyoung@yahoo.com>
@ 2011-12-10 22:42 ` Jasen Betts <jasen@xnet.co.nz>
  1 sibling, 0 replies; 3+ messages in thread

From: Jasen Betts @ 2011-12-10 22:42 UTC (permalink / raw)
  To: pgsql-sql

On 2011-12-08, chester c young <chestercyoung@yahoo.com> wrote:
> have an db with about 15 tables that will handle many companies.  no data overlap between companies.  is it more efficient run-time to use one database and index each row by company id, and one database and partition each table by company id, or to create a database for each company?
>
> it is a web-based app using persistent connections.  no copying.
>

if you know you will never want to aggregate data across several
companies. databases are cheap, portable, easily duplicated, and
self-contained, can easily be dumped, restored, and dropped 
individually, go with one per company. 

if there's a possibility you may want to merge two companies, or
aggregate data in some other way you want to put them all in the
same database so that sequences can be shared to ensure that ids 
are unique etc...  you still have the option of partitioning by
schema, table name, or just by tagging each record.

-- 
⚂⚃ 100% natural




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-12-10 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-08 14:26 partitions versus databases chester c young <chestercyoung@yahoo.com>
2011-12-09 01:13 ` Craig Ringer <ringerc@ringerc.id.au>
2011-12-10 22:42 ` Jasen Betts <jasen@xnet.co.nz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox