It's me again with my Postgres 7.4 database and my quest to speed up graph and screen display for long periods.
I saw requests like this many times :
and the same from table trends or history_uint, etc.
This request takes a bit too much time (more than a second).
I read Postgres 7.4 documentation and it says that Postgres don't use indexes for aggregates functions because users can create there own aggregates.
It says that to have best results it is recommended to replace a request like :
with :
I don't know if it's the same for latest 8.3 version, documentation is not as precise on this point.
Thanks for your lights.
I saw requests like this many times :
Code:
select min(clock) from history where itemid=18356
This request takes a bit too much time (more than a second).
I read Postgres 7.4 documentation and it says that Postgres don't use indexes for aggregates functions because users can create there own aggregates.
It says that to have best results it is recommended to replace a request like :
Code:
SELECT min(col) FROM sometable;
Code:
SELECT col FROM sometable ORDER BY col ASC LIMIT 1;
Thanks for your lights.