in reply to Big database queries

This isn't perl-y - but why not a stored procedure?