Re: Postgres is too slow?

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Paul Mamin" <magamos(at)mail(dot)ru>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgres is too slow?
Date: 2001-06-21 08:49:16
Message-ID: 005601c0fa2f$0f410460$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: "Paul Mamin" <magamos(at)mail(dot)ru>

> Under Postgres I filled this table by COPY FROM cause.
>
> And I made the SELECT that browse the whole table:
> -----
> select field1, sum(field2-field3)/count(*)
> from table1
> group by field1;
> -----
> 1) It's speed almost doesnt depend from index on field1.

Since you'll be accessing all the records anyway, I'm not sure use of an
index would make sense. Try EXPLAIN SELECT ... to see what postgesql thinks
is happening.

> 2) I made VACUUM ANALYZE

Well - PG knows the shape of the tables then.

> And ... MSSQL 7.0 worked in 2-2.5 times faster that Postgres :((

Can't really say - could be count(*) isn't being cached. Could be MSSQL is
just more efficient at this query. Bear in mind that MS may not be popular
with everyone, but their developers aren't idiots.

Post the output of the EXPLAIN and we'll see if PG is making any odd
assumptions.

- Richard Huxton

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2001-06-21 08:53:47 Re: Hardware Config
Previous Message Richard Huxton 2001-06-21 08:43:19 Re: this is a "If update confirmed, commit, else rollback" question.