pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Merlin Moncure <mmoncure@gmail.com>
To: Carlo Stonebanks <stonec.register@sympatico.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance Optimization for Dummies 2 - the SQL
Date: Mon, 16 Oct 2006 17:07:11 -0400
Message-ID: <b42b73150610161407l55e66854g94b31de6dd511f16@mail.gmail.com> (raw)
In-Reply-To: <egua6n$1fv4$1@news.hub.org>
References: <eft782$5a1$1@news.hub.org>
	<b42b73150610042326v7fdeed17rf6b96e52a681a6db@mail.gmail.com>
	<eg2cds$29en$1@news.hub.org>
	<b42b73150610050630t76e9eedeh45a382729d35f2f6@mail.gmail.com>
	<eg611q$l0m$1@news.hub.org>
	<1160153623.6181.13.camel@state.g2switchworks.com>
	<b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.com>
	<eg6f8l$2det$1@news.hub.org>
	<b42b73150610090649y74c4dc99g176366921f784e7b@mail.gmail.com>
	<egua6n$1fv4$1@news.hub.org>

On 10/15/06, Carlo Stonebanks <stonec.register@sympatico.ca> wrote:
> that contains full address data
> */
> select
>     f.facility_id,
>     null as facility_address_id,
>     null as address_id,
>     f.facility_type_code,
>     f.name,
>     null as address,
>     f.default_city as city,
>     f.default_state_code as state_code,
>     f.default_postal_code as postal_code,
>     f.default_country_code as country_code,
>     null as parsed_unit
> from
>     mdx_core.facility as f
> left outer join mdx_core.facility_address as fa
>     on fa.facility_id = f.facility_id
> where
>      facility_address_id is null
>      and f.default_country_code = 'US'
>      and (f.default_postal_code = '14224-1945' or f.default_postal_code =
> '14224')

what is the facility_address_id is null all about? remove it since you
hardcode it to true in select.

you have a two part part key on facility(country code, postal code), right?

merlin



view thread (38+ messages)  latest in thread

Message-ID: <b42b73150610161407l55e66854g94b31de6dd511f16@mail.gmail.com>
Permalink:  ../b42b73150610161407l55e66854g94b31de6dd511f16@mail.gmail.com/
Also on:    postgresql.org/message-id/b42b73150610161407l55e66854g94b31de6dd511f16@mail.gmail.com

 · 

reply

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: mmoncure@gmail.com, stonec.register@sympatico.ca
  Subject: Re: Performance Optimization for Dummies 2 - the SQL
  In-Reply-To: <b42b73150610161407l55e66854g94b31de6dd511f16@mail.gmail.com>
  References: <eft782$5a1$1@news.hub.org> <b42b73150610042326v7fdeed17rf6b96e52a681a6db@mail.gmail.com> <eg2cds$29en$1@news.hub.org> <b42b73150610050630t76e9eedeh45a382729d35f2f6@mail.gmail.com> <eg611q$l0m$1@news.hub.org> <1160153623.6181.13.camel@state.g2switchworks.com> <b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.com> <eg6f8l$2det$1@news.hub.org> <b42b73150610090649y74c4dc99g176366921f784e7b@mail.gmail.com> <egua6n$1fv4$1@news.hub.org> <b42b73150610161407l55e66854g94b31de6dd511f16@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