Couchbase N1QL query really slow

Hi, I have problem with couchbase. I installed this db on my local notebook for test. Don’t create new bucket’s. I added 2 millions records in ‘default’ bucket. Before I create index on this bucket. Next write query "Select * from default WHERE index_default = “l200000” ". After 2 minutes return one record. I tested the same in SQL db and return one record in 1 sec. Where is the problem? I read that NoSQL is faster than SQL.

What you read is incorrect. It is not true that NoSQL is faster than SQL, just as it is not true that SQL is faster than NoSQL.

What are you trying to accomplish? You can try the following query in Couchbase:

SELECT *
FROM default
LIMIT 1;

Should be fast.

If you want to use a WHERE clause, you need an index. That is how Couchbase works.

What does it mean? I don’t understand.

I set index on field which be in WHERE.

Did you runt he query without the WHERE clause? How long did it take?

I change server and now I have (for 100 000 rows):
6,48sec with WHERE and 6,02sec with LIMIT

When I use SQL on the same server have:
2,688 with WHERE and 1,938 with LIMIT

What’s a problem? I want to use noSQL for log’s base but at this time I can’t because slow.