Query optimization problem

Поиск
Список
Период
Сортировка
От Peter
Тема Query optimization problem
Дата
Msg-id 45c337aa$0$1345$834e42db@reader.greatnowhere.com
обсуждение исходный текст
Ответы Re: Query optimization problem  (Richard Huxton <dev@archonet.com>)
Re: Query optimization problem  (Peter <peter@greatnowhere.com>)
Список pgsql-general
I'm not sure if I'm heading up the right alley - seems too simple!, but
here is my issue.

I have about 3000 records in 'mytable', and simple

select * from mytable where x=1

is timed as:

Total query runtime: 2933 ms.
Data retrieval runtime: 791 ms.

EXPLAIN says it's Seq Scan, but the actual filter expression I'm using
returns me all rows from the table anyway. If I run

select * from mytable

Total query runtime: 3444 ms.
Data retrieval runtime: 771 ms.

At the same time:

select * into x from prl_user_entities

Query returned successfully with no result in 600 ms.

Why SELECT takes 3+ second to execute? Is it something to do with my
Postgres server optimization, or PgAdmin does not show correct data
retrieval runtime (leaks over into query runtime or something)?

This is PG 8.1 on FreeBSD, server is fairly powerful PC.

Peter

В списке pgsql-general по дате отправления:

Предыдущее
От: "Tomi N/A"
Дата:
Сообщение: Re: database backup trouble
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Backup ?