bug-recutils
[Top][All Lists]
Advanced

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

Gathering multiple statistics at once


From: Liliana Marie Prikler
Subject: Gathering multiple statistics at once
Date: Fri, 14 Jan 2022 16:41:07 +0100
User-agent: Evolution 3.42.1

Hi folks,

I'm trying to gather some statistics for a recfile I have, and it turns
out that the only way of doing so currently are repeated calls to
recsel, which perform a little more IO operations than would actually
be needed.  So I wrote a small utility, that does all of those DB
queries in one go, see the attachment.  (Please pardon the lack of
tests.)

I'm not quite sure whether the approach I've taken is the right one.
Ideally, I'd like to instead extend field expressions, so that one
could use selection expressions inside of them, e.g. Count(name) would
count the number of name fields, but Count(name = 'Alice') would count
the number of name fields, which are equal to 'Alice'.  Then, I could
do a (collapsing) recsel over my phonebook and print "Count(name =
'Alice'),Count(name = 'Bob')...", which would tell me how many Alices,
Bobs, and so on, I know.  For practical purposes, it might be necessary
to impose that a name always be set with the colon operator.

I hope my idea is getting across somewhat.  WDYT?

Attachment: 0001-Add-recstat-utility.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]