Re: Why does this query write to the disk?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Nikolas Everett" <nik9000(at)gmail(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Why does this query write to the disk?
Date: 2008-09-18 17:49:48
Message-ID: 48D24E6C.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>>> "Nikolas Everett" <nik9000(at)gmail(dot)com> wrote:

> I'm a bit confused as to why this query writes to the disk:
> SELECT count(*)
> FROM bigbigtable
> WHERE customerid IN (SELECT customerid FROM
> smallcustomertable)
> AND x !=
> 'special'
>
> AND y IS NULL
>
> It writes a whole bunch of data to the disk that has the tablespace
where
> bigbigtable lives as well as writes a little data to the main disk.
It
> looks like its is actually WAL logging these writes.

It's probably writing hint bits to improve performance of subsequent
access to the table. The issue is discussed here:

http://wiki.postgresql.org/wiki/Hint_Bits

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2008-09-18 18:13:20 Re: Why does this query write to the disk?
Previous Message Nikolas Everett 2008-09-18 17:30:42 Why does this query write to the disk?