Обсуждение: more performance on some aggregates

Поиск
Список
Период
Сортировка

more performance on some aggregates

От
Peter Vazsonyi
Дата:
I've created a table, and index.
Table    = test
+----------------------------+----------------------------+-------+
|           Field            |           Type             | Length|
+----------------------------+----------------------------+-------+
| a                          | int4                       |     4 |
| c                          | varchar                    |    40 |
+----------------------------+----------------------------+-------+
Index:    _test_a
if i need the max or min value of column a i can get with
SELECT max(test.a); query.
If i take look on the query tree:
Aggregate  (cost=43.00 rows=1000 width=4)
  ->  Seq Scan on test  (cost=43.00 rows=1000 width=4)
...
Ok, i understand: all type of the aggregates work on same way, but...
have i any chance to get extrem values, without seq scan?

Thanx in advice

--
 nek;(