added sql's for matrix calculation and keyword_search in documents