Couchbase request runtime?

How can I calculate the query execution time and query execution in Couchbase. Are there any utilities like Oracle Explain plan and tkprof in Couchbase db?

edit:


I am trying to see which database is best for my data. So I'm trying to experiment with mysql, mongodb, couchbase. I tried with three different record numbers 10k, 20k, 40k.

In mysql, I can see the query time using "set profiling = 1". with these settings, I ran queries in three scenarios 1) without indexing the primary key, 2) after indexing the primary key 3) re-executing the same query a second time (to see the effect of query caching)

Similarly, I ran the same tests with mongodb and summarized my results in a table format. I would like to run the same tests with couchbase to see how well it will work. I tried to search the network, but could not find anything that I could do to get similar results.

Below is a table (all times in milliseconds). the second line with braces () shows the request time for the second run.

  Records Count Mysql MongoDB CouchBase
         ___________________ _______________ ___________
         Without |  With Without |  With with index
         Index |  Index Index |  Index 

 10K 62.27325 |  8.537 3311 |  33
         (33.3135) |  (3.27825) (7) |  (0)




 20K 108.4075 |  23.238 132 |  39    
         (80.90525) |  (4.576) (17) |  (0)



 40K 155.074 |  26.26725 48 |  ten
         (110.42) |  (10.037) (42) |  (0)


For couchbase, I would like to know how performance is when fetching a document using its key (similar function as memcahed). Also, the request time uses its representations.

+6
source share
1 answer

You must understand that couchbase works differently with RDBMS, such as Oracle. Couchbase offers two ways to get your data:

1) Key search, you know the key of the document (s) that you want to receive.

2) Define the "Reduce map" tasks, called "Views", which create indexes that allow you to query your data for attributes other than the key.

Couchbase docs are always consistent, but views are not and ultimately are sequential (although you have the option to change this).

The couchbase documentation documentation states

Views are updated when document data is saved to disk. The delay between creating or updating a document and updating a document in a view.

So the query time really depends on many factors, can the browsing data be out of date? How big is the data emitted from the index, and what is the current workload and db size? Couchbase provides the following 3 flags for working with views and how you want to access data. False means that the index must be updated before returning the result, so it can be slow.

  • false: force update of the view before returning data
  • ok: Allow deprecated views
  • update_after: allow obsolete view, view update after it has been reached.

For more information see the official document http://docs.couchbase.com/couchbase-manual-2.2/#views-and-indexes

You can also read this interesting article on caching http://blog.couchbase.com/caching-queries-couchbase-high-performance

Currently, there is N1QL in the development of Couchbase, effectively the version of the SQL version of couchbase, it will have an EXPLAIN statement, it will not be released until the end of 2014. I suppose.

N1QL Blog Post http://blog.couchbase.com/n1ql-it-makes-cents

Cheat sheet for N1QL http://www.couchbase.com/communities/sites/default/files/Couchbase-N1QL-CheatSheet.pdf

And where you can download the dev preview if you want to play with N1QL http://www.couchbase.com/communities/n1ql

Also pull out the cb stats tool http://docs.couchbase.com/couchbase-manual-2.2/#cbstats-tool , it gives an overview of persistence level, updates, key passes, etc. at a high level.

+11
source

Source: https://habr.com/ru/post/959478/


All Articles