From: Dave Johansen <davejohansen@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Pushing LIMIT into sub-queries of a UNION ALL?
Date: Mon, 23 May 2011 08:54:52 -0700
Message-ID: <BANLkTinDP_Kk9ShZ+VBAeeTRDQGiDnqTxg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=-dhJuyMLQU6SyS1YEa0co_3Bjxw@mail.gmail.com>
References: <BANLkTi=XnAaiiCA=5hbX1Sg6jCDQ6ZmChA@mail.gmail.com>
<BANLkTi=-dhJuyMLQU6SyS1YEa0co_3Bjxw@mail.gmail.com>
I apologize for the multiple posts. I sent this email right after joining
the list and after it hadn't shown up a day later I figured that it had been
lost or something and sent the other one.
Also, the database I posted this about does not have internet access and so
I'm working on getting it moved over to a machine that does or getting it
the info onto a machine where I can post the pertinent information about the
schema and explain outputs.
Thanks,
Dave
--
Dave Johansen
phone: (520) 302-4526
On Sun, May 22, 2011 at 10:34 AM, Robert Klemme
<shortcutter@googlemail.com>wrote:
> Dave,
>
> how often do you want to repeat that posting? What about instead
> replying to the answers you got so far?
>
> Cheers
>
> robert
>
>
> On Tue, May 17, 2011 at 5:31 PM, Dave Johansen <davejohansen@gmail.com>
> wrote:
> > I am using Postgres 8.3 and I have an issue very closely related to the
> one
> > described here:
> > http://archives.postgresql.org/pgsql-general/2005-06/msg00488.php
> >
> > Basically, I have a VIEW which is a UNION ALL of two tables but when I do
> a
> > select on the view using a LIMIT, it scans the entire tables and takes
> > significantly longer than writing out the query with the LIMITs in the
> > sub-queries themselves. Is there a solution to get the view to perform
> like
> > the sub-query version?
> >
> > Thanks,
> > Dave
>
>
>
> --
> remember.guy do |as, often| as.you_can - without end
> http://blog.rubybestpractices.com/
>
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-performance@postgresql.org
Cc: davejohansen@gmail.com
Subject: Re: Pushing LIMIT into sub-queries of a UNION ALL?
In-Reply-To: <BANLkTinDP_Kk9ShZ+VBAeeTRDQGiDnqTxg@mail.gmail.com>
References: <BANLkTi=XnAaiiCA=5hbX1Sg6jCDQ6ZmChA@mail.gmail.com> <BANLkTi=-dhJuyMLQU6SyS1YEa0co_3Bjxw@mail.gmail.com> <BANLkTinDP_Kk9ShZ+VBAeeTRDQGiDnqTxg@mail.gmail.com>
* 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