From: | Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com> |
---|---|
To: | Francisco Reyes <lists(at)natserv(dot)com> |
Cc: | pgsql General List <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Dealing with complex queries |
Date: | 2003-02-04 19:07:36 |
Message-ID: | 20030204190736.85888.qmail@web20802.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Try creating an index on the substrings: you will need
to wrap the substring in a function marked "immutable"
(or "with (iscachable)" for versions prior to 7.3) for
the index to be of any use.
I have done a lot of the sort of thing you describe,
with good results using that method.
--- Francisco Reyes <lists(at)natserv(dot)com> wrote:
> On Tue, 4 Feb 2003, Bruno Wolff III wrote:
>
> > On Mon, Feb 03, 2003 at 16:32:10 -0500,
> > Francisco Reyes <lists(at)natserv(dot)com> wrote:
> > > Any hints suggestions on dealing with complex
> queries.
> >
> > > substring(ppl.carried_as from 1 for 3)
> > > = substring(jc.last from 1 for
> 3) and
> >
> > Joining on substrings is a good sign that your
> design needs rethinking.
>
> The tables in the substring comparison are some of
> our tables compared
> to tables supplied by another company. It is a fact
> that the names don't
> always match and have variations.
>
> The whole excersise is to match by names to then
> populate our table with
> their keys so in the future we can match by keys in
> feeds we receive from
> them.
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Gregory Stark | 2003-02-04 19:11:20 | not exactly a bug report, but surprising behaviour |
Previous Message | Tom Lane | 2003-02-04 18:26:15 | Re: 7.2.1: coalesce double-calls function? |