Re: Postgres is too slow? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Postgres is too slow?
Date
Msg-id 005601c0fa2f$0f410460$1001a8c0@archonet.com
Whole thread Raw
In response to Postgres is too slow?  (Paul Mamin <magamos@mail.ru>)
Responses Re[2]: Postgres is too slow?  (Paul Mamin <magamos@mail.ru>)
List pgsql-general
From: "Paul Mamin" <magamos@mail.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


pgsql-general by date:

Previous
From: "Richard Huxton"
Date:
Subject: Re: Hardware Config
Next
From: "Richard Huxton"
Date:
Subject: Re: this is a "If update confirmed, commit, else rollback" question.