Re: Which gives good performance? separate database vs separate schema

From: tv(at)fuzzy(dot)cz
To: "Divakar Singh" <dpsmails(at)yahoo(dot)com>
Cc: tv(at)fuzzy(dot)cz, "Andres Freund" <andres(at)anarazel(dot)de>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Which gives good performance? separate database vs separate schema
Date: 2010-11-25 15:46:33
Message-ID: 3f676eb8bdbe62c203eae4d06f25ddb4.squirrel@sq.gransy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> I am not facing any issues, but yes I want to have optimal performance for
> SELECT and INSERT, especially when I am doing these ops repeatedly.
> Actually I am porting from Oracle to PG. Oracle starts a lot of processes
> when
> it needs to run many schemas. I do not think PG would need much more
> resources
> (mem, cpu) if I go for different database for each process..? Also, is
> there any
> limit on number of databases I can start using a PG server?

Hm, I would try to run that using single cluster, and only if that does
not perform well I'd try multiple clusters. Yes, Oracle starts a lot of
processes for an instance, and then some processes for each connection.

But again - in PostgreSQL, you do not start databases. You start a
cluster, containing databases and then there are connections. This is
similar to Oracle where you start instances (something like cluster in
PostgreSQL) containing schemas (something like databases in PostgreSQL).
And then you create connections, which is the object consuming processes
and memory.

PostgreSQL will create one process for each connection (roughly the same
as Oracle in case of dedicated server). And yes, the number of connections
is limited - see max_connections parameter in postgresql.conf.

Tomas

>
>
> Best Regards,
> Divakar
>
>
>
>
> ________________________________
> From: "tv(at)fuzzy(dot)cz" <tv(at)fuzzy(dot)cz>
> To: Andres Freund <andres(at)anarazel(dot)de>
> Cc: pgsql-performance(at)postgresql(dot)org; tv(at)fuzzy(dot)cz; Divakar Singh
> <dpsmails(at)yahoo(dot)com>
> Sent: Thu, November 25, 2010 5:55:33 PM
> Subject: Re: [PERFORM] Which gives good performance? separate database vs
> separate schema
>
>> On Thursday 25 November 2010 13:02:08 tv(at)fuzzy(dot)cz wrote:
>>> I don't think you'll get performance improvement from running two
>>> PostgreSQL clusters (one for DB1, one for DB2). And when running two
>>> databases within the same cluster, there's no measurable performance
>>> difference AFAIK.
>> That one is definitely not true in many circumstances. As soon as you
>> start to
>> hit contention (shared memory, locks) you may very well be better of
>> with
>> two
>> separate clusters.
>>
>> Andres
>>
> Good point, I forgot about that. Anyway it's hard to predict what kind of
> performance issue he's facing and whether two clusters would fix it.
>
> regards
> Tomas
>
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>
>
>
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2010-11-26 02:00:29 Re: Performance under contention
Previous Message Divakar Singh 2010-11-25 14:53:40 Re: Which gives good performance? separate database vs separate schema