Re: PostgreSQL optimizer use seq scan instead of pkey index only scan (in queries with postgres_fdw) - Mailing list pgsql-performance

From Tom Lane
Subject Re: PostgreSQL optimizer use seq scan instead of pkey index only scan (in queries with postgres_fdw)
Date
Msg-id 16478.1557157999@sss.pgh.pa.us
Whole thread Raw
In response to Re: PostgreSQL optimizer use seq scan instead of pkey index only scan(in queries with postgres_fdw)  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: PostgreSQL optimizer use seq scan instead of pkey index only scan(in queries with postgres_fdw)
List pgsql-performance
Jeff Janes <jeff.janes@gmail.com> writes:
> It works the way you want in version 12, which is currently under
> development and should be released in 5 months or so.

Even in older versions, the OP would get a significantly smarter
plan after setting use_remote_estimate = on.  I think the core
issue here is that we won't generate remote parameterized paths
without that:

    /*
     * If we're not using remote estimates, stop here.  We have no way to
     * estimate whether any join clauses would be worth sending across, so
     * don't bother building parameterized paths.
     */
    if (!fpinfo->use_remote_estimate)
        return;

            regards, tom lane



pgsql-performance by date:

Previous
From: Vitaly Baranovsky
Date:
Subject: Re: PostgreSQL optimizer use seq scan instead of pkey index only scan(in queries with postgres_fdw)
Next
From: Jeff Janes
Date:
Subject: Re: PostgreSQL optimizer use seq scan instead of pkey index only scan(in queries with postgres_fdw)