Re: Need help on a troublesome query plan

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Alain Lavigne <alavigne(at)zaq(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Need help on a troublesome query plan
Date: 2002-07-16 18:52:05
Message-ID: 20020716115118.L51289-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Tue, 16 Jul 2002, Alain Lavigne wrote:

> Index "bld_x1_tb_bus_fact"
> Column | Type
> -----------------+---------------
> party_id | bigint
> bus_fact_typ_cd | character(10)
> cont_id | bigint
> btree
>
> With the following query on 50000 records:
>
> explain
> SELECT bld_TB_BUS_FACT.BUS_FACT_ID AS id
> FROM bld_TB_BUS_FACT
> WHERE bld_TB_BUS_FACT.PARTY_ID=1320677
> AND bld_TB_BUS_FACT.BUS_FACT_TYP_CD='MSG_SENT'
> AND bld_TB_BUS_FACT.CONT_ID=786448
> AND bld_TB_BUS_FACT.BUS_FACT_KYWRD ILIKE '%MT-ID=3407979%'
> AND bld_TB_BUS_FACT.BUS_FACT_KYWRD ILIKE '%S-ID=1310723%'
> limit 1;

You'll need to either single quote or explicitly cast the
constants you're comparing to the bigint columns.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Alain Lavigne 2002-07-16 19:02:28 Re: Need help on a troublesome query plan
Previous Message Ron Johnson 2002-07-16 18:38:22 Re: Seeding