Re: quick question abt pg_dump and restore - Mailing list pgsql-general

From Gregory Stark
Subject Re: quick question abt pg_dump and restore
Date
Msg-id 87wsqijwng.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: quick question abt pg_dump and restore  ("Josh Harrison" <joshques@gmail.com>)
List pgsql-general
"Josh Harrison" <joshques@gmail.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!

pgsql-general by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: performance differences of major versions
Next
From: Robert Treat
Date:
Subject: Re: Kernel kills postgres process - help need