Hi All,

We use a very simple purge policy

purge_policies
{
    policy      default
    {
        condition
        {
            last_access > 30d
        }
    }
}

and an equally simple trigger

# Nuke Daily
Purge_Trigger
{
    trigger_on         = periodic ;
    check_interval     = 24h ;
}

however the DB query to generate this is taking ages due to the default sort

'SELECT id FROM ENTRIES WHERE (ENTRIES.invalid=0 OR ENTRIES.invalid IS
NULL) AND ENTRIES.type<>'dir' AND (ENTRIES.last_access<1425402865 OR
ENTRIES.last_access IS NULL) ORDER BY ENTRIES.last_access ASC LIMIT
100000':


+----+-----------+-----------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+----------+
| Id | User      | Host    | db          | Command | Time | State
    | Info
                                    | Progress |
+----+-----------+------------------------------------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+----------+
| 20 | robinhood | redacted  | rbh_scratch | Query   |  562 | Sorting
result | SELECT id FROM ENTRIES WHERE (ENTRIES.invalid=0 OR
ENTRIES.invalid IS NULL) AND ENTRIES.type<>'dir'  |    0.000 |
+----+-----------+-----------+-------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+----------+

but doing the same query *without* the sort is orders of magnitude faster
...
| 0x200ad7945:0x13c55:0x0 |
| 0x200ad7945:0x13c56:0x0 |
| 0x200ad7945:0x13c57:0x0 |
+-------------------------+
100000 rows in set (0.14 sec)


Given that we don't care about starting with the oldest, is there a
command line option or some config to stop the sorting?

or, do I have to remove it from the source in
./src/policy_modules/purge/resmon_purge.c


(or, if there's some horrible consequence of not sorting, please let me know!)


Many thanks

Andrew

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
robinhood-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/robinhood-support

Reply via email to