4

I have three tables(x,y,z) in one database "123" like RDBMS. I want to convert them into couchDB. I have created the.json for each and every tables. When i created the database,i could not create seperate tables. I had to create seperate db for each table or combine under one db. How can i create a sub tables under one db ? P.S:The problem with combining all of them is taking up too much time to retrieve all of them or looking through.

Please tell me how to organize the documents into tables or x,y,z categories atleast...

Chris Snow
  • 23,813
  • 35
  • 144
  • 309
  • Can you please elaborate on what you mean by 'The problem with combining all of them is taking up too much time to retrieve all of them or looking through'? – Chris Snow Jun 01 '15 at 14:05
  • 1
    Thanks for your reply... I have got 9 million documents together. If i want to perform simple count operation taking hours. If i query a data which is belong to 'x' th table, it is searching through all the 'y' and 'z' 's documents also.. –  Jun 01 '15 at 15:00

1 Answers1

3

Based on the comments, one option is to use a document type attribute:

{
  "_id": 123,
  "doc_type": "x",
  ...
}

Eg.

{
  "_id": 234,
  "doc_type": "y",
  ...
}

You can then create a map/reduce view to index on the doc_type.

Chris Snow
  • 23,813
  • 35
  • 144
  • 309