Performance issue getting a mongo document

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Raul
Posts: 4
Joined: Sat 28 Apr 2018 00:55

Performance issue getting a mongo document

Post by Raul » 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

Code: Select all

...
      SQLText := '{"find":"Sessions", "filter":{"_id":"' + SessionId + '"}}';

      Query.Connection := Connection;
      Query.SQL.Text   := SQLText;
      Query.Open;

      Document := Query.GetObject('Sessions') as TMongoDocument;
...
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.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Performance issue getting a mongo document

Post by azyk » Tue 15 May 2018 08:17

Please send MongoDB document (or JSON) on which the issue is reproduced via the contact form at our site https://www.devart.com/company/contactform.html

Post Reply