From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Sriram Dandapani <sdandapani@counterpane.com>
Cc: Pgsql-Performance (E-mail) <pgsql-performance@postgresql.org>
Subject: Re: creating of temporary table takes very long
Date: Tue, 18 Apr 2006 18:48:32 -0400
Message-ID: <19622.1145400512@sss.pgh.pa.us> (raw)
In-Reply-To: <20060418223410.GL49405@pervasive.com>
References: <6992E470F12A444BB787B5C937B9D4DF0406A79C@ca-mail1.cis.local>
<20060418223410.GL49405@pervasive.com>
"Jim C. Nasby" <jnasby@pervasive.com> writes:
> You might try rewriting the coalesces into a row comparison...
> WHERE row($4, $5, ...) IS NOT DISTINCT FROM row(interface_id, source_id, ...)
That would be notationally nicer, but no help performance-wise; I'm
fairly sure that IS DISTINCT doesn't get optimized in any fashion
whatsoever :-(
What might be worth trying is functional indexes on the COALESCE(foo,0)
expressions. Or if possible, consider revising your data schema to
avoid using NULLs in a way that requires assuming that NULL = NULL.
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-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, jnasby@pervasive.com, sdandapani@counterpane.com
Subject: Re: creating of temporary table takes very long
In-Reply-To: <19622.1145400512@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