Re: Slow count(*) again...

From: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "david(at)lang(dot)hm" <david(at)lang(dot)hm>, Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, Vitalii Tymchyshyn <tivv00(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow count(*) again...
Date: 2010-10-12 14:04:18
Message-ID: 4CB46AE2.7030006@vmsinfo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Tom Lane wrote:
> Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com> writes:
>
>> The number of rows is significantly smaller, but the table contains
>> rather significant "text" field which consumes quite a bit of TOAST
>> storage and the sizes are comparable. Postgres read through 27GB in 113
>> seconds, less than 2 minutes and oracle took 2 minutes 37 seconds to
>> read through 35GB. I stand corrected: there is nothing wrong with the
>> speed of the Postgres sequential scan.
>>
>
> Um ... the whole point of TOAST is that the data isn't in-line.
> So what Postgres was actually reading through was probably quite a
> lot less than 27Gb. It's probably hard to make a completely
> apples-to-apples comparison because the two databases are so different,
> but I don't think this one proves that PG is faster than Oracle.
>
> regards, tom lane
>

As is usually the case, you're right. I will try copying the table to
Postgres over the weekend, my management would not look kindly upon my
copying 35GB of the production data during the working hours, for the
scientific reasons. I have the storage and I can test, I will post the
result. I developed quite an efficient Perl script which does copying
without the intervening CSV file, so that the copy should not take more
than 2 hours. I will be able to impose a shared lock on the table over
the weekend, so that I don't blow away the UNDO segments.

--

Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
http://www.vmsinfo.com
The Leader in Integrated Media Intelligence Solutions

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-10-12 14:09:09 Re: security hook on table creation
Previous Message Kevin Grittner 2010-10-12 13:56:33 Re: Slow count(*) again...

Browse pgsql-performance by date

  From Date Subject
Next Message Joe Uhl 2010-10-12 14:19:57 Re: Slow count(*) again...
Previous Message Kevin Grittner 2010-10-12 13:56:33 Re: Slow count(*) again...