Re: [GENERAL] Indices and Foreign Tables

2014-04-04 Thread Torsten Förtsch
On 04/04/14 17:14, Kohler Manuel (ID SIS) wrote: > Here is the same query with fdw: > > db=# EXPLAIN VERBOSE select ds.code, count(*), sum(dsf.size_in_bytes) as > "raw_size",pg_size_pretty(sum(dsf.size_in_bytes)) as "size" from > data_set_files_fdw dsf, data_sets_fdw ds where dsf.parent_id is nu

Re: [GENERAL] Indices and Foreign Tables

2014-04-04 Thread Tom Lane
"Kohler Manuel (ID SIS)" writes: > here are the Query plans. The first plan is on the source database directly. > So no fdw involved: Do you have use_remote_estimate enabled? The rowcount estimates for the foreign tables seem pretty far from reality; use_remote_estimates should help.

Re: [GENERAL] Indices and Foreign Tables

2014-04-04 Thread Kohler Manuel (ID SIS)
Hi, here are the Query plans. The first plan is on the source database directly. So no fdw involved: source_db=# EXPLAIN ANALYZE select ds.code, count(*), sum(dsf.size_in_bytes) as "raw_size",pg_size_pretty(sum(dsf.size_in_bytes)) as "size" from data_set_files dsf, data_sets ds where dsf.parent

Re: [GENERAL] Indices and Foreign Tables

2014-04-04 Thread Albe Laurenz
Kohler Manuel wrote: > I have a question regarding the use of indices when querying foreign data > tables (using postgres_fdw > of 9.3 to another postgres DB). > Everything works fine beside the fact that the indices which are defined in > the foreign DB are not > used at all when I do query it t