significantly (1000x) improve performance of some sql queries involving the huge measurements table
fix tiny link redirection bug
merge