Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchDB query performance

If the number of documents is more will the querying of data gets slower in CouchDB?

Example Scenario:

  • I have a combobox in a form for customer name. When the user types the customer name, I have to do autofilling.
  • There will be around 10k customer documents in the CouchDB. I understand that i have to create a view to do the same.
  • CouchDB database is in the local machine where the application resides.

Question: Will it take more than 2 - 3 seconds to query the DB for matching customer names? Will querying take more time for each query if there are many documents in the CouchDB (say around 100000 documents)?

Any pointers on how to create views/index will be helpful.

Thanks in advance.

like image 332
Sundar Avatar asked Apr 06 '10 21:04

Sundar


1 Answers

The view runs on every document, but only once. After that, the document's view value(s) are stored forever. Fetching a customer by name will be very fast because you would normally have only a few new documents to process in the view at query time.

Query time will not increase noticeably if you have more documents. Technically, access times grow logarithmically with the number of documents. However, in practice fetching documents is basically constant time and very unlikely to be a problem.

like image 95
JasonSmith Avatar answered Oct 13 '22 18:10

JasonSmith