Re: Postgres is too slow?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Postgres is too slow?
Дата
Msg-id 005601c0fa2f$0f410460$1001a8c0@archonet.com
обсуждение исходный текст
Ответ на Postgres is too slow?  (Paul Mamin <magamos@mail.ru>)
Ответы Re[2]: Postgres is too slow?  (Paul Mamin <magamos@mail.ru>)
Список 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 по дате отправления:

Предыдущее
От: "Richard Huxton"
Дата:
Сообщение: Re: Hardware Config
Следующее
От: "Richard Huxton"
Дата:
Сообщение: Re: this is a "If update confirmed, commit, else rollback" question.