spring-data-couchbase icon indicating copy to clipboard operation
spring-data-couchbase copied to clipboard

findAll using N1QL is faster [DATACOUCH-233]

Open spring-projects-issues opened this issue 9 years ago • 1 comments

Ali Shahbour opened DATACOUCH-233 and commented

When trying to use findAll backed up by view it would take around 10 second to retrieve 327 document out of 900 document the total size of bucket , while if i used another N1QL query to get all the documents i got them in fraction of second .

public interface CountryRepository extends CrudRepository<Country, String> {
    @Query("#{#n1ql.selectEntity} WHERE #{#n1ql.filter}")
    List<Country> findAllCountries();
}

what i noticed is that when using N1QL i got all the document at once ops went up to 250 while when using view it stay between 6 and 8 for around 10 second .

I think N1QL should be the default backend for all queries including findAll


Reference URL: http://stackoverflow.com/questions/37560663/spring-data-couchbase-findall-speed/37649932#37649932

Issue Links:

  • DATACOUCH-228 findByView could be made more performant by using async API internally

spring-projects-issues avatar Jun 06 '16 05:06 spring-projects-issues

Simon Baslé commented

As confirmed on StackOverflow, the view-based findAll is more performant when using async API internally (see DATACOUCH-228). Putting this into backlog as there could come a point where view-based CRUD is switched to N1QL

spring-projects-issues avatar Jun 13 '16 09:06 spring-projects-issues

N1QL is used for all the find operations. Views are deprecated.

mikereiche avatar May 09 '23 23:05 mikereiche