[Info-vax] VMS MAIL: order of DELETE

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Mon Oct 21 09:02:01 EDT 2019


On 2019-10-21, Craig A. Berry <craigberry at nospam.mac.com> wrote:
> On 10/20/19 5:50 PM, Simon Clubley wrote:
>> On 2019-10-20, Volker Halle <volker_halle at hotmail.com> wrote:
>>> Phillip,
>>>
>>> routine mail$cmd_delete in module [MAILSHR] has:
>>>
>>>       INCR i FROM 1 TO .mail$gl_message_count
>>>
>>> where mail$gl_message_count is 'Number of messages selected'
>>>
>>> So if specifying MAIL> DELETE/ALL all the selected mails seem to be
>>> deleted in ascending message number order.
>>>
>> 
>> Wouldn't it be more efficient to delete the files in reverse order ?
>> 
>> That way, if you are deleting a large number of messages at once,
>> you don't end up having to shuffle down directory blocks which are
>> going to be deleted anyway.
>
> As far as I can remember, deleting mail messages may or may not involve
> deleting files, depending on the size of the message.  And even if the
> order in the file system has anything to do with the order in which
> messages are received (I don't remember how the files get named),
> deleting most recent messages first might actually do what you are
> suggesting, depending on what the naming convention is.
>

The filename includes the VMS style binary timestamp.

When I looked at a sample of mailbox entries before writing the above,
they were all in ascending date order in the directory. However, I've
now seen others which are not in ascending date order (based on the
output from dir/date).

I'll modify my suggestion to say that if they were sorted in filename
order and deleted in reverse, then that would still appear to be more
efficient because you are trading off a small amount of sort time versus
the time taken to shuffle down the directory entries.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.



More information about the Info-vax mailing list