From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dawn Hollingsworth <dmh@airdefense.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Query Against a dblink View Takes Too Long to Return
Date: Mon, 03 Mar 2003 21:43:27 -0500
Message-ID: <19784.1046745807@sss.pgh.pa.us> (raw)
In-Reply-To: <1046710746.1290.3.camel@kaos>
References: <1046710746.1290.3.camel@kaos>
Dawn Hollingsworth <dmh@airdefense.net> writes:
> Nested Loop (cost=0.00..466.51 rows=1 width=24) (actual
> time=226.39..1018072.99 rows=9353 loops=1)
> -> Subquery Scan t1 (cost=0.00..0.01 rows=1 width=0) (actual
> time=225.99..345.86 rows=9353 loops=1)
> -> Result (cost=0.00..0.01 rows=1 width=0) (actual
> time=225.98..303.29 rows=9353 loops=1)
> -> Seq Scan on allowed_station_view av (cost=0.00..162.53 rows=9353
> width=20) (actual time=0.01..31.77 rows=9353 loops=9353)
> Total runtime: 1018092.69 msec
The planner evidently thinks that dblink() will return only one row,
and consequently it chooses a plan that would be fast in that case
... but is dog-slow for 9000 rows.
Probably the easiest answer is to update to 7.3 and use the new
function-in-FROM syntax for invoking dblink. That should result
in more useful assumptions about the number of rows returned.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, dmh@airdefense.net
Subject: Re: Query Against a dblink View Takes Too Long to Return
In-Reply-To: <19784.1046745807@sss.pgh.pa.us>
* 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