Re: Accessing 2 different databases in the same query ? - Mailing list pgsql-general

From Joe Conway
Subject Re: Accessing 2 different databases in the same query ?
Date
Msg-id 3EDB8139.6000900@joeconway.com
Whole thread Raw
In response to Re: Accessing 2 different databases in the same query ?  (Nagib Abi Fadel <nagib_postgres@yahoo.com>)
List pgsql-general
Nagib Abi Fadel wrote:
> Well actually the 2 databases are on the same machine, so i wanted to
> know if  using the dblink for accessing 2 tables each one in a
> different database will dramatically slow down the query (specially
> if it's a join query), Comparing to a query on 2 tables on the same
> database. If it's the case i would consider replacing the 2 databases
> with one database, but does this have any disadvantage does it make
> queries slower if the database grow in size ???
>

dblink is using a client library and is therefore certainly slower than
backend heap access.

Whether the slowdown is "dramatic" or not, is a dependent on *your*
definition of dramatic, and the specifics of what you are trying to do.
I'd suggest you try it and find out.

If it's too slow to meet your needs, and you are able to combine the two
databases into two schemas of one database, then do that instead.

Joe


pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: The best
Next
From: "Sean Mullen"
Date:
Subject: array [] vs {}