Thanks Lahav, This does put it more into perspective.
I actually was trying to find out which way to go to optimize the speed as much as possible. And although a difference of 150 ms does sound ridiculous, I assume that with more data, and used repetitively in loops, it will be a substantial difference. Rudy Mortier Two Way Communications bvba > On 30 Jul 2018, at 06:37, lists via 4D_Tech <[email protected]> wrote: > > Rudy, > > I think part of the reason might be that with ORDA you actually have the data > loaded and ready to use in the resulting collection, where as with QUERY you > have a selection of records, but to use any of the data you still need to > load it somehow. > > Also, using QUERY, regardless of speed, allow you access to one selection of > records only, where as with ORDA, you can just execute the same query with > different parameters in to a different collection and have as many different > selection of records at the same time. > > I would think that a real test should be a complete task rather than one > isolated part, and then make a decision as to which option makes more sense > for that given task. > > Regards, > > Lahav > > -----Original Message----- > From: 4D_Tech <[email protected]> On Behalf Of Two Way > Communications via 4D_Tech > Sent: Sunday, July 29, 2018 5:47 AM > To: 4D iNug Technical <[email protected]> > Cc: Two Way Communications <[email protected]> > Subject: Confused about ORDA > > I am a bit confused… isn’t ORDA supposed to be faster than traditional > queries? > > I did a test with a table containing 120,000 records. The query is on 4 > indexed fields and returns 54,000 records. > > Doing the query with ORDA takes 175 milliseconds. > Doing the query with QUERY takes 4 milliseconds. > > Why?? > > ORDA: > $oQRYoption:=New object("queryPlan";False;"queryPath";False) > > $oTLD:=ds.T_Loggers_data.query("TLR.FK_REAP =:1 AND TLD_timestamp >=:2 AND > TLD_timestamp <=:3 AND Excluded > =:4";[REAP_sections]FK_REAP;$TSsectionStart;$TSsectionEnd;False;$oQRYoption) > > > > Traditional: > QUERY([T_Loggers_data];[T_loggers_readings]FK_REAP=[REAP_sections]FK_REAP;*) > > QUERY([T_Loggers_data];[T_Loggers_data]TLD_timestamp>=$TSsectionStart;*) > QUERY([T_Loggers_data];[T_Loggers_data]TLD_timestamp<=$TSsectionEnd;*) > QUERY([T_Loggers_data];[T_loggers_readings]Excluded=False) > > > Rudy Mortier > Two Way Communications bvba > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

