Optimal methods for large-scale scientific database and sparse matrix applications