rima.lua: limit select result by 1000