Re: How to find out about index

From: Savita <savita(at)india(dot)hp(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to find out about index
Date: 2002-10-08 06:52:15
Message-ID: 3DA2809F.23D3787E@india.hp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

What does the row indicate in the NOTICE: QUERY PLAN:

I am getting diff-2 values which is not same as the actual row present in the table.

For example
with select statement
TESTDATA=# explain select * from os_customer_master;
NOTICE: QUERY PLAN:

Seq Scan on os_customer_master (cost=0.00..20.00 rows=1000 width=112)
==============================================================================
with where clause
TESTDATA=# explain select * from os_customer_master where outsourcer_legacy_custo
mer_id='66084';
NOTICE: QUERY PLAN:

Seq Scan on os_customer_master (cost=0.00..22.50 rows=10 width=112)
=================================================================================
After creating index on outsourcer_legacy_custo
mer_id

TESTDATA=# explain select * from os_customer_master where outsourcer_legacy_custo
mer_id='66084';
NOTICE: QUERY PLAN:

Index Scan using cust_1 on os_customer_master (cost=0.00..12.22 rows=11 width=112)

I can see that the cost has reduced but the rows has increased.What does this means and
also what does width means.

any help will be highly appriciated.

Shridhar Daithankar wrote:

> On 8 Oct 2002 at 11:21, Savita wrote:
>
> > Hi all,
> >
> > I am new to postgre.I want to create index on some of the column.
> >
> > I just wanted to know that how to find out on which column we need to
> > create index because using explain command I am not getting the clear
> > picture as we get in oracle if we use the same explain plan command.
>
> Create indexes on columns that are used in where condition of select query.
>
> HTH
>
> Bye
> Shridhar
>
> --
> Lie, n.: A very poor substitute for the truth, but the only one discovered to
> date.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karel Zak 2002-10-08 07:07:49 Re: Server locale?
Previous Message Henrik Steffen 2002-10-08 06:31:53 deadlock detected