Search Postgresql Archives

Query optimization problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux