pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zoltan Boszormenyi <zboszor@dunaweb.hu>
To: pgsql-odbc@postgresql.org
Subject: PsqlODBC slow on UNION queries
Date: Mon, 09 Jan 2006 06:44:42 +0100
Message-ID: <43C1F84A.90707@dunaweb.hu> (raw)

Hi,

we are using PowerBuilder for development and I experimented a little
with PostgreSQL-8.1 through ODBC and I experienced the following
on psqlodbc-8.01.0106.

We have some large views, consisting of 6+ UNION members.
Recently, I rewrote them to use UNION ALL, since the members
give distinct rows across the whole view.

The performance difference between the two is enormous, e.g. using UNION,
the rows starts flowing only after 30-32 seconds but when using UNION ALL,
it starts instantly. Doing the same in psql like below runs under 4 seconds
using UNION and under about 12 seconds using UNION ALL, and this
includes getting all the rows from the server.

time echo "select * from view_x" | psql db >result.txt

What may cause such a large difference?




view thread (15+ messages)  latest in thread

Message-ID: <43C1F84A.90707@dunaweb.hu>
Permalink:  ../43C1F84A.90707@dunaweb.hu/
Also on:    postgresql.org/message-id/43C1F84A.90707@dunaweb.hu

 · 

reply

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-odbc@postgresql.org
  Cc: zboszor@dunaweb.hu
  Subject: Re: PsqlODBC slow on UNION queries
  In-Reply-To: <43C1F84A.90707@dunaweb.hu>
  References: <43C1F84A.90707@dunaweb.hu>

* 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