Performance issue getting a mongo document
Posted: Mon 14 May 2018 22:26
Hi,
I am testing UniDac 7.2.7 for RAD Studio XE4 and MongoDB. I am having some performance issues trying to retrieve a very large BSon Document. The document is a session in JSon with more than 1500 lines and 40kb of size (I tried to upload the file but I don't find where)
My code is this
It runs properly, but the Query.Open instruction last more than 4 minutes. With others lighter documents goes very fast.
Is this the normal performance? Can I optimized the code somehow? Is my JSon Session file too large?
Thanks in advance.
I am testing UniDac 7.2.7 for RAD Studio XE4 and MongoDB. I am having some performance issues trying to retrieve a very large BSon Document. The document is a session in JSon with more than 1500 lines and 40kb of size (I tried to upload the file but I don't find where)
My code is this
Code: Select all
...
SQLText := '{"find":"Sessions", "filter":{"_id":"' + SessionId + '"}}';
Query.Connection := Connection;
Query.SQL.Text := SQLText;
Query.Open;
Document := Query.GetObject('Sessions') as TMongoDocument;
...
Is this the normal performance? Can I optimized the code somehow? Is my JSon Session file too large?
Thanks in advance.