From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyle <kyle@actarg.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: A query that doesn't work on 7.1
Date: Thu, 08 Mar 2001 19:39:23 -0500
Message-ID: <3064.984098363@sss.pgh.pa.us> (raw)
In-Reply-To: <3AA82201.C22A5BAB@actarg.com>
References: <3AA6C0AD.BC8A015A@actarg.com>
<19632.984010093@sss.pgh.pa.us>
<24466.984016499@sss.pgh.pa.us>
<3AA7E16D.C9B4FA76@actarg.com>
<29675.984081236@sss.pgh.pa.us>
<3AA82201.C22A5BAB@actarg.com>
Kyle <kyle@actarg.com> writes:
>> You could probably gin up a usable avg(timestamp) using the avg(float8)
>> routines, since a timestamp is really just a double under the hood.
> When you say "gin up" are you talking about C, PL/XXX, or just casts?
I was thinking of full-scale cheating: make a new pg_aggregate entry for
avg(timestamp) that points at the existing pg_proc entries that support
avg(float8). CREATE AGGREGATE won't do this for you, but there's always
good old INSERT INTO ...
> Here's a view of a union. The two selects are fast when executed
> individually (and explain confirms that they use indexes). When I
> query the view, though, it is slow (explain says the scans are
> sequential).
> Is this expected or a bug?
Seems odd. Need enough info to reproduce, please?
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 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-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, kyle@actarg.com
Subject: Re: A query that doesn't work on 7.1
In-Reply-To: <3064.984098363@sss.pgh.pa.us>
References: <3AA6C0AD.BC8A015A@actarg.com> <19632.984010093@sss.pgh.pa.us> <24466.984016499@sss.pgh.pa.us> <3AA7E16D.C9B4FA76@actarg.com> <29675.984081236@sss.pgh.pa.us> <3AA82201.C22A5BAB@actarg.com> <3064.984098363@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