Re: quick question abt pg_dump and restore

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Josh Harrison" <joshques(at)gmail(dot)com>
Cc: "Andreas Kretschmer" <akretschmer(at)spamfence(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: quick question abt pg_dump and restore
Date: 2008-01-10 01:29:23
Message-ID: 87wsqijwng.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Josh Harrison" <joshques(at)gmail(dot)com> writes:

> Aggregate (cost=342178.51..342178.52 rows=1 width=0)
> -> Bitmap Heap Scan on person (cost=3120.72..341806.71 rows=148721 width=0)
> Recheck Cond: (person_id > 1146000000::numeric)
> -> Bitmap Index Scan on person_pk (cost=0.00..3083.53 rows=148721 width=0)
> Index Cond: (person_id > 1146000000::numeric)
...
> How does the planner choose the plan?

The short answer is that it looks at the "cost" for all the reasonable plans
it can come up with and picks the plan with the lowest cost.

Scans which return many rows will tend to prefer bitmap index scans (when they
don't do a full sequential scan of the t table) since it avoids random access.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's 24x7 Postgres support!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2008-01-10 03:12:35 Re: Kernel kills postgres process - help need
Previous Message Greg Smith 2008-01-10 01:09:51 Re: Storing and querying boolean fields