Re: [GENERAL] EXPLAIN ANALYZE not considering primary and unique indices!

2007-08-29 Thread Sanjay
Thanks a lot everybody! I got it clear. I was wrongly thinking that PostgreSQL might not be creating the indices by default. regards Sanjay ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscri

Re: [GENERAL] EXPLAIN ANALYZE not considering primary and unique indices!

2007-08-27 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > In response to Sanjay <[EMAIL PROTECTED]>: >> Seq Scan on website (cost=0.00..1.31 rows=1 width=162) (actual >> time=0.047..0.051 rows=1 loops=1) >> Filter: (website_id = 1) >> Total runtime: 0.102 ms >> Wondering why it is not using the index, which woul

Re: [GENERAL] EXPLAIN ANALYZE not considering primary and unique indices!

2007-08-27 Thread Alan Hodgson
On Monday 27 August 2007 05:21, Sanjay <[EMAIL PROTECTED]> wrote: >Wondering why it is not using the index, which would have > been > automatically created for the primary key. Because you not only have just one row in the whole table, 100% of them will match the query. In short, one page fetch f

Re: [GENERAL] EXPLAIN ANALYZE not considering primary and unique indices!

2007-08-27 Thread Bill Moran
In response to Sanjay <[EMAIL PROTECTED]>: > Hi All, > > Say I have a simple table WEBSITE(website_id int4 PRIMARY KEY, name > VARCHAR(30)). While I try this: > > EXPLAIN ANALYZE SELECT * FROM WEBSITE WHERE website_id = 1 > > the output is: >

Re: [GENERAL] EXPLAIN ANALYZE not considering primary and unique indices!

2007-08-27 Thread Joseph S
How many rows are in this table? Sanjay wrote: Hi All, Say I have a simple table WEBSITE(website_id int4 PRIMARY KEY, name VARCHAR(30)). While I try this: EXPLAIN ANALYZE SELECT * FROM WEBSITE WHERE website_id = 1 the output is: