From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Foreign table performance issue / PostgreSQK vs. ORACLE
Date: Fri, 29 Jan 2021 15:40:21 +0100
Message-ID: <7289a882-66eb-c0d4-dc7a-c6ab16eb0201@gmx.net> (raw)
In-Reply-To: <f3b693bf6e5842bda2b7077469504eca@MS-FRA-E13EX02.intl.ad.vzwcorp.com>
References: <f3b693bf6e5842bda2b7077469504eca@MS-FRA-E13EX02.intl.ad.vzwcorp.com>
Markhof, Ingolf schrieb am 29.01.2021 um 13:56:
> The set-up basically is a production database and a reporting
> database. As names indicate, the production database is used for
> production, the reporting database is for analysis. On the reporting
> database, the only way to access product data is via foreign tables
> that link to the related production tables.>
>
> However, the same set-up worked fine in Oracle before. Reporting
> wasn't always fast, but it delivered results in acceptable time. A
> query executed on the Oracle reporting server returns data in e.g. 30
> seconds. But running the query translated to PostgreSQL on the
> PostgreSQL DB does not deliver a single row after hours (!) of run
> time.
>
> So, I wonder: Is there a fundamental difference between Oracle
> database links and foreign tables in PostgreSQL that could explain
> the different run times?
My guess is, that your queries use predicates that can't be pushed down
to the foreign server on Postgres, but Oracle can.
What is your Postgres version?
If my assumption is correct, then maybe if you showed one example query,
it might be possible to figure out a way to restructure it.
Is logical replication an option?
How accurate does the data on the reporting server need to be?
Would using materialized views that "cache" the foreign table be an
option? That's obviously only suitable if you can live with some
stale data and are fine with refreshing them maybe twice a day
(depending on how fast the refresh is)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: shammat@gmx.net
Subject: Re: Foreign table performance issue / PostgreSQK vs. ORACLE
In-Reply-To: <7289a882-66eb-c0d4-dc7a-c6ab16eb0201@gmx.net>
References: <f3b693bf6e5842bda2b7077469504eca@MS-FRA-E13EX02.intl.ad.vzwcorp.com> <7289a882-66eb-c0d4-dc7a-c6ab16eb0201@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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