From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Nikolas Everett <nik9000@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Why does this query write to the disk?
Date: Thu, 18 Sep 2008 12:49:48 -0500
Message-ID: <48D24E6C.EE98.0025.0@wicourts.gov> (raw)
In-Reply-To: <d4e11e980809181030t3f09db94vd5b69d7868271906@mail.gmail.com>
References: <d4e11e980809181030t3f09db94vd5b69d7868271906@mail.gmail.com>
>>> "Nikolas Everett" <nik9000@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, nik9000@gmail.com
Subject: Re: Why does this query write to the disk?
In-Reply-To: <48D24E6C.EE98.0025.0@wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox