Re: how to use all the options of EXPLAIN? - Mailing list pgsql-general

From Guillaume Lelarge
Subject Re: how to use all the options of EXPLAIN?
Date
Msg-id 1316113593.3666.13.camel@localhost.localdomain
Whole thread Raw
In response to Re: how to use all the options of EXPLAIN?  (AI Rumman <rummandba@gmail.com>)
List pgsql-general
On Thu, 2011-09-15 at 12:17 +0600, AI Rumman wrote:
> When I am using the following query, I got shared hit=8857.
>
> EXPLAIN (buffers true, analyze) select * from act;
>                                                         QUERY
> PLAN
>
--------------------------------------------------------------------------------------------------------------------------
>  Seq Scan on act  (cost=0.00..6308.82 rows=542312 width=735) (actual
> time=0.007..516.199 rows=542312 loops=1)
>    Buffers: shared hit=8857
>  Total runtime: 1004.067 ms
>
> Wherears, when I am using the following query, I got  Buffers: shared
> hit=416 read=46350
>
>  EXPLAIN (buffers true, analyze) select * from crm;
>
>                                                           QUERY
> PLAN
>
-------------------------------------------------------------------------------------------------------------------------------
>  Seq Scan on crm  (cost=0.00..21558.94 rows=1688234 width=333) (actual
> time=0.040..1738.903 rows=1688291 loops=1)
>    Buffers: shared hit=416 read=46350
>  Total runtime: 3257.872 ms
>
> Could you please tell me why the different that is why I get read for one
> query and not for others?
>

The act table was in PostgreSQL cache memory, so it reads it from there.
A small part of the crm table was in PostgreSQL cache memory, it read
this part from there, but had to ask the OS to get the rest of the table
from the OS memory or from disk.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


pgsql-general by date:

Previous
From: Andy Colson
Date:
Subject: Re: Apparent Problem With NULL in Restoring pg_dump
Next
From: Rich Shepard
Date:
Subject: Re: Apparent Problem With NULL in Restoring pg_dump