The problem is that it uses the "acs_objects.last_modified" for the parent thread to get the last_modified date and either we need a trigger to update the parent last modified date
or we have to rewrite the query.
It looks like it is wrong for both oracle and postgresql.