On Sat, 23 Apr 2005, Bruce Momjian wrote:
> Log Message:
> -----------
> Remove item, not sure what it refers to:
>
> < * Allow ORDER BY ... LIMIT 1 to select high/low value without sort or
> < index using a sequential scan for highest/lowest values
> <
> < If only one value is needed, there is no need to sort the entire
> < table. Instead a sequential scan could get the matching value.
> <
This is actually a suggestion from Oleg here:
http://archives.postgresql.org/pgsql-general/2002-04/msg00464.php
double min = DBL_MAX;
for (i=0; i<N; i++) {
if (data[i] < min) {
min = data[i];
}
}
Kris Jurka