Find the below my observations, when i load 0.1Million records of data,
In SQL Insert : 8.633 Secs/record
Object Save (%Save) : 21.94 Secs/record
But some of my friends not accept this. Now i want to know which one faster.Hi Dhanapal
My rule of thumb is
Global inserts = factor of 1
SQL Inserts/updates = 2-3 x the above
Object Inserts/Updates = 8-10 x the above
Which you use depends on the use case – I mostly use SQL and only use objects if I have to (ie in the ZEN MVC setup)
= =
If you are doing a one off bulk load a quick and easy way to speed things up is to turn off transaction journaling with
Do DISABLE^%NOJRN
And turn it on again after with
Do ENABLE^%NOJRN
This prevents the journal file needing to be written – you lose transactions (trollback) but if it’s a one off then that probably does not really matter
= =
You might ask why use objects at all rather than a plain old SQL database….
For me the answer is that you get a rich data structure (parent/child and one/many relationships) and the ISC extended SQL makes good use of this
Eg suppose you have
Invoice Header (with a relationship to the Sales Account)
Invoice Lines (with a parent relationship of a header and a relationship with Product Code)
So you can construct some SQL like
Select Quantity,Cost from InvoiceLines where rParent->SalesAccount.Code=’ABC’ and ProductCode->Name=’widget’
Which will tell you how many “widgets” you have sold to company “abc”
This extended SQL is many times more compact that standard SQL with inner/outer joins (which I have never fully understood)
And if you have indices (which are defined automatically with relationships) then the above will be milli-second quick even if there are a squillion records
HTH
Peter
PS it’s been several major versions of Cache since I did the timings above – and I know the gap between Object & SQL has narrowed – but it’s still there
--
--
Caché, Ensemble, DeepSee
---
You received this message because you are subscribed to the Google Groups "Caché, Ensemble, DeepSee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--