0
votes

I am using Marklogic 8 and using the Java API to retrieve and store documents.
All my documents store (JSON files) are at the maximum of 2Kb file size.
I have two questions: Indexes are set on most of the JSON nodes by which am querying.
The search will by default include a range of timestamp (in long) i.e., an inclusive search of to and from timestamps. Plus any any other node as requested by the end user.
The code uses QBE approach to query the database.

Question 1: Is there a better approach like String Query Definition search, Key-Value Search, Structured Query Definition or Combined Query search that has better performance than Query By Example

Question 2: Will the machine it is running on have an impact on the performance?
Am now working on my local Windows machine but eventually the Marklogic will be hosted on a UNIX machine in production.
Am not sure of the specs though for the Unix machine.

1

1 Answers

5
votes

QBE and String queries are translated in the server into Structured Queries. So starting directly with Structured Queries should give you your best performance, though the difference should be negligible. Combined Queries are less ideal than storing your options in the server as there is some overhead in sending your options along with each query.

The machine will of course have an impact on performance. Be sure to read through the Installation Guide as you spec your production machine and configure the OS. Also make sure to follow the Query Performance Guide and help knowledgebase articles on tuning.