Re: To prefer sorts or filters in postgres, that is the question.... - Mailing list pgsql-general

From Laurenz Albe
Subject Re: To prefer sorts or filters in postgres, that is the question....
Date
Msg-id 1523953145.2361.2.camel@cybertec.at
Whole thread Raw
In response to Re: To prefer sorts or filters in postgres, that is the question....  (Bob Jones <r.a.n.d.o.m.d.e.v.4+postgres@gmail.com>)
List pgsql-general
Bob Jones wrote:
> My current thinking is that the filter is a bit like an "fgrep" and
> the sort actually requires memory allocation and some "real work", and
> thus I've settled on the filter for now pending experiments with a
> larger quantity of data.

That's fine.

A top-1-sort is less work than you maybe think:
You go through all items and find the biggest one.
So there is one comparison operator per row - very similar to
what happens when "grepping" for NULL values.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com


pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: pg_dump to a remote server
Next
From: Gao Jack
Date:
Subject: RE: pg_dump to a remote server