| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com> | 
| Cc: | Sriram Dandapani <sdandapani(at)counterpane(dot)com>, "Pgsql-Performance (E-mail)" <pgsql-performance(at)postgresql(dot)org> | 
| Subject: | Re: creating of temporary table takes very long | 
| Date: | 2006-04-18 22:48:32 | 
| Message-ID: | 19622.1145400512@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-performance | 
"Jim C. Nasby" <jnasby(at)pervasive(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2006-04-18 23:08:33 | Re: Multicolumn order by | 
| Previous Message | Jim C. Nasby | 2006-04-18 22:34:11 | Re: creating of temporary table takes very long |