Re: 2 machines, same database, same query, 10 times slower?

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: 2 machines, same database, same query, 10 times slower?
Date: 2012-05-08 19:15:28
Message-ID: 4FA970D0.3020000@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8.5.2012 20:32, Antonio Goméz Soto wrote:
>> > Do this on both machines to verify that
>> >
>> > SELECT relpages, reltuples FROM pg_class WHERE relname = 'cdr';
> Slow machine:
>
> relpages | reltuples
> ----------+-----------
> 400566 | 982321
>
> Fast machine:
>
> relpages | reltuples
> ----------+-------------
> 62076 | 1.48375e+06
>
>

Yup, that's probably the culprit. The slow machine has to read 400000
pages while the fast one just 62000. Each page is 8kB, so this is 3GB
vs. 500MB difference.

T.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message MD33 2012-05-08 22:05:46 Re: COPY column order
Previous Message Pavel Stehule 2012-05-08 19:03:08 Re: 2 machines, same database, same query, 10 times slower?