pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
select from dblink very slow
2+ messages / 2 participants
[nested] [flat]

* select from dblink very slow
@ 2007-05-18 13:20  Jessica Richard <rjessil@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Jessica Richard @ 2007-05-18 13:20 UTC (permalink / raw)
  To: pgsql-admin

I need to joint select from table A in the current database A and dblink to table B in database B, the result coming from tableB in db B is very slow because I have to select all the rows from tableB from dblink then do "where" with table A in the current db....doing dblink this way is very very slow....

Any idea on how to improve this?

Thanks,
Jessica

       
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

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

* Re: select from dblink very slow
@ 2007-05-18 16:31  Joe Conway <mail@joeconway.com>
  parent: Jessica Richard <rjessil@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Joe Conway @ 2007-05-18 16:31 UTC (permalink / raw)
  To: Jessica Richard <rjessil@yahoo.com>; +Cc: pgsql-admin

Jessica Richard wrote:
> I need to joint select from table A in the current database A and dblink 
> to table B in database B, the result coming from tableB in db B is very 
> slow because I have to select all the rows from tableB from dblink then 
> do "where" with table A in the current db....doing dblink this way is 
> very very slow....
> 
> Any idea on how to improve this?

About the only thing I can think of using dblink would be to use a 
PL/pgSQL function to dynamically build and execute your query in such a 
way that the WHERE clause is pushed to the remote query.

Someone else suggested dbi-link as an alternative -- I don't know for 
sure, but suspect it will suffer from the same issue as dblink.

I also saw a suggestion of using different schemas instead of different 
databases. This is the best solution if it is feasible.

Finally, I don't know much about it, but perhaps PL/proxy would make it 
easier to push down your WHERE clause:
   https://developer.skype.com/SkypeGarage/DbProjects/PlProxy

HTH,

Joe



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


end of thread, other threads:[~2007-05-18 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-05-18 13:20 select from dblink very slow Jessica Richard <rjessil@yahoo.com>
2007-05-18 16:31 ` Joe Conway <mail@joeconway.com>

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