Re: Index Scans become Seq Scans after VACUUM ANALYSE

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Michael Loftis <mloftis(at)wgops(dot)com>
Cc: Curt Sampson <cjs(at)cynic(dot)net>, mlw <markw(at)mohawksoft(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Date: 2002-04-25 15:01:02
Message-ID: 200204251501.g3PF12513440@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Loftis wrote:
> A Block-sized read will not be broken up. But if you're reading ina
> size bigger than the underlying systems block sizes then it can get
> broken up.
>
> So yes a sequential read will get broken up. A single read request for
> a block may or may not get broken up. If you're freading with set block
> sizes you'll see the set sizes of blocks come through, but what the
> underlying OS does is undefined, same for writing. If the underlying
> block size is 8KB and you dump 4MB down on it, the OS may (and in many
> cases does) decide to write part of it, do a read ona nearby sector,
> then write the rest. This happens when doing long writes that end up
> spanning block groups because the inodes must be allocated.

Also keep in mind most disks have 512 byte blocks, so even if the file
system is 8k, the disk block sizes are different. A given 8k or 1k file
system block may not even be all in the same cylinder.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2002-04-25 15:21:14 Re: Block size: 8K or 16K?
Previous Message Bruce Momjian 2002-04-25 14:55:58 Re: Sequential Scan Read-Ahead