我将大约 900 个文档添加到两种类型 ( Country and Rate
) 的沙发库中,然后尝试通过扩展CrudRepository
和使用来检索一种类型 CountryfindAll
public interface CountryRepository extends CrudRepository<Country, String> {
}
.
public interface RateRepository extends CrudRepository<Rate, String> {
List<Rate> findByTopTrue();
List<Rate> findByCountryStartingWith(String country);
List<Rate> findByCountryIsoCode(String isoCode);
}
我按照要求创建了所有视图,但结果大约需要 10 秒,这是否正常,请注意,当我在 RateRepository 中使用其他方法时,它们的速度非常快。
我还为 Rate 中的顶部字段创建了主索引和 GSI。
如何检查速度问题是否与 couchbase 或 spring-data 相关?