Multiple queries in create_sparse_feature_matrix to improve performance