Re: How to find out about index - Mailing list pgsql-general

From Savita
Subject Re: How to find out about index
Date
Msg-id 3DA2809F.23D3787E@india.hp.com
Whole thread Raw
In response to Re: How to find out about index  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Responses Re: How to find out about index  (Martijn van Oosterhout <kleptog@svana.org>)
Re: How to find out about index  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
List 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@postgresql.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)
----------------------------------------------------
 

pgsql-general by date:

Previous
From: "Henrik Steffen"
Date:
Subject: deadlock detected
Next
From: Karel Zak
Date:
Subject: Re: Server locale?