[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gathering multiple statistics at once
From: |
Jose E. Marchesi |
Subject: |
Re: Gathering multiple statistics at once |
Date: |
Thu, 20 Jan 2022 15:40:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi Liliana.
> 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?
I certainly see the merits of having a tool like recstat. I am busy now
with another project, but I will be back to recutils soon and follow up
on this.