Re: Creating index does not make any change in query plan. - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: Creating index does not make any change in query plan.
Date
Msg-id 3E50E9C0.31008.8EB854C@localhost
Whole thread Raw
In response to Re: Creating index does not make any change in query plan.  (Deepa <kdeepa@midascomm.com>)
Responses Re: Creating index does not make any change in query plan.  (Deepa <kdeepa@midascomm.com>)
List pgsql-general
On 17 Feb 2003 at 14:02, Deepa wrote:
>     After doing Vacuum analyzing only I started doing the test. The
> table also had nearly 1 lakh record. Then what could be the possible
> reason.

1 lakh == 100,000 records, just to make things clear..
>
> On Mon, 17 Feb 2003, Martijn van Oosterhout wrote:
>
> > On Mon, Feb 17, 2003 at 01:06:26PM +0530, Deepa wrote:
> > > Hi,
> > >     When I do explain on 'activealarms' table while selecting
> > > a row with primary key (AFAIK while creating primary key, an index will be
> > > created on that column), the following result occurs.
> > >
> > > EXPLAIN SELECT * from activealarms where recordid = 2;
> > > NOTICE:  QUERY PLAN:
> > >
> > > Seq Scan on activealarms  (cost=0.00..7122.86 rows=1 width=189)
> > >
> > > EXPLAIN
> > >
> > > Here 'recordid' is the primary key whose datatype is bigint.
> >
> > Out of curiosity, what happens with:
> >
> > EXPLAIN SELECT * from activealarms where recordid = '2';

Did you try this or explicitly casting this '2' to smallint/bigint?

Bye
 Shridhar

--
Fun Facts, #14:    In table tennis, whoever gets 21 points first wins.  That's how
it once was in baseball -- whoever got 21 runs first won.


pgsql-general by date:

Previous
From: Deepa
Date:
Subject: Re: Creating index does not make any change in query plan.
Next
From: Deepa
Date:
Subject: Re: Creating index does not make any change in query plan.