select only active resources, with consistent ordering and proper support for 'from' and 'max' parameters