Skip site navigation (1) Skip section navigation (2)

Re: subquery and table join, index not use for table

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: CoL <col(at)mportal(dot)hu>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: subquery and table join, index not use for table
Date: 2004-01-16 17:48:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Wed, 14 Jan 2004, CoL wrote:
>     ->  Seq Scan on menutable b  (cost=0.00..13.01 rows=38 width=22)
> (actual time=0.02..0.38 rows=38 loops=1)

>     ->  Index Scan using menutable_pkey on menutable b
> (cost=0.00..29.36 rows=38 width=22) (actual time=0.02..0.12 rows=38 loops=1)

It's estimating a cost of 13 for the sequence scan and 29 for the index
scan so it's choosing the sequence scan.

 The value of random_page_cost may be too high for your system and
especially so if the database is small and likely to fit in ram.  In
addition, if the table in question is small, you'll likely find that at
some point for a larger data set that the system switches over to an index

In response to

pgsql-performance by date

Next:From: Stephan SzaboDate: 2004-01-16 18:17:50
Subject: Re: Join optimisation Quandry
Previous:From: scott.marloweDate: 2004-01-16 17:20:24
Subject: Re: shared_buffer value

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group