PsqlODBC slow on UNION queries

From: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
To: pgsql-odbc(at)postgresql(dot)org
Subject: PsqlODBC slow on UNION queries
Date: 2006-01-09 05:44:42
Message-ID: 43C1F84A.90707@dunaweb.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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?

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Zoltan Boszormenyi 2006-01-09 06:13:03 Re: PsqlODBC slow on UNION queries
Previous Message Tom Lane 2006-01-09 05:18:42 Re: PsqlODBC slow on UNION queries