Re: Too much blocks read

From: Craig James <craig_james(at)emolecules(dot)com>
To: Waldomiro <waldomiro(at)shx(dot)com(dot)br>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Too much blocks read
Date: 2009-11-18 16:29:53
Message-ID: 4B042101.5090500@emolecules.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Waldomiro wrote:
> ...
> I´m thinking It hapens because in the 7 millions tables, the same 8k
> block has diferent records with different keys, so only a few records
> with 'my_key' is retrieved when I read a 8k block.
> In the part_table, all records stored in a 8k block have 'my_key', so
> It´s much optimized.
>
> My doubt, there is a way to defrag my 7 millions table to put all
> records with the same key in the same 8k block?

Read about the "CLUSTER ON index-name" SQL command. It does exactly what you're asking.

Craig

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message A. Kretschmer 2009-11-18 16:30:44 Re: Too much blocks read
Previous Message Matthew Wakeling 2009-11-18 16:23:48 Re: Too much blocks read