Solved

Which is better?

Posted on 2004-09-16
28
202 Views
Last Modified: 2013-12-18
Set Doc = ViewEntry.Document

or

Set Doc = DB.GetDocumentByUNID(ViewEntry.ColumnValues(0))


The first column has the unique ID of the document. I will need to update the document and save it.
0
Comment
Question by:RanjeetRain
  • 10
  • 7
  • 5
  • +4
28 Comments
 
LVL 14

Assisted Solution

by:p_partha
p_partha earned 120 total points
ID: 12078872
As far as i know it's very tough to determine ranjeet,Let's try to interpret this way

db. Getdocumentbyunid is a function call
viewentry.document is a property. Obviously accessing a property value shd be easier than a function call ..

But i have heard cases where it is interpreted like searching a document by unid is always faster

BTW recently sjef was doing some R&D on performance, better to get it from horse's mouth

My 2 cents

Partha
0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12079319
Kinda I also think like that. But could it be the other way round? Lets hear what others have to say. These small small things can add upto a big saving on the performance in routines that run for long durations.
0
 
LVL 19

Assisted Solution

by:madheeswar
madheeswar earned 30 total points
ID: 12081536
I agree with Partha.
GetDocumentByUNID is faster.
0
 
LVL 15

Accepted Solution

by:
Bozzie4 earned 140 total points
ID: 12081658
Well , it depends.

If you have a large number of documents to process, then 'walking the view' may (test this) be faster, but if it's just 1 document you need to access, the GetDocumentByUNID is certainly (I'm 100% sure here) faster.
It's the same for @getdocfield against @dblookup : if you need to take only 1 field value from a document, the @getdocfield is waaaay faster than a @dblookup, but if you need more values from the same view/document, you may consider @dblookup (and use caching)


Check http://www.martinscott.com .  They have a performance report to compare several functions in several situations, but you need to be aware that things may change between versions (some functions get performance boosts, other remain the same, so 1 may overtake another in speed from 1 version to the next)



cheers,

Tom
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 110 total points
ID: 12084201
Hiiiiiiiiihhiiiiii (that's the horse speaking)

My assumption, because I never looked into this in detail. If you already have the ViewEntry, then getting the document is but one step away. You might have fast access to the ColumnValues property, but access to db and then to the GetDocumentByUnid method, with a parameter, will take a lot longer. I think. But that holds only if you already have the ViewEntry.

My 2 Eurocents...
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 12084675
Yes, but you need to create a notesview object first , and this is very expensive performancewise.  So if you only need 1 document, getdocumentbyunid is certainly faster, because you don't need to create the notesview object

cheers,

Tom
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12084977
Yes, but Ranjeet used a ViewEntry in both cases. So it's already there, implicitely... :-D
0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12085588
Good good. Nice to have more views and finding how much you agree or differ with others :D

Thanks. So, the verdict is, use navigation thru the view entry as repetitive calls to GetDocumentByUNID wont be much efficient. Right?

Now now. Do you huys want points too :D
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12086135
Ranjeet,
Also give the environment where u are goign to use it, if you say schedule agent or a notes client agent, i might not bother very much about performance. If it is a web agent, then we have to look at it in a different perspective altogether

Partha

(Btw, if sjef gets points for this Q, then i also need points :))

0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12086652
Ok Partha, Go ahead and tell me. It isn't bad to know anything.

I discarded the environment on purpose. Long questions can be read differently. Shorter the question lesser the chances of people emphasizing on the wrong spot.

PS: Okay. I conclude you dont want points for this as Sjef isn't opting for. Well, that leaves two contenders for the points. Hmmm...
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12087496
Who says I'm not opting?? Partha and I, we invested a grand total of 4 cents in this question, so we deserve to get our fair share. And, since nobody else invested anything, who are the contenders? I say...

But, as usual, too small a description leaves too many open options. I assumed there is a ViewEntry available, as Partha did, but you never confirmed our assumption. What's the verdict anyway, what do YOU think?

Sjef ;)

PS There should be a Db.CallThisProcedureOnEveryDocumentThatMatchesThisQuery method. Swiftest on earth.
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12087688
Is there any online resource that documents the inner deep architecture of the Lotus Notes system?

It seems that we need it a lot!! There should be no secret about how to answer the RanjeetRain's question...

0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12088610
I would conclude - most people are of opinion that while GetDocumentByUNID is a faster method, it may or may not offer the same benefit if called repetitively.

Okay, lets count the votes. Pls vote in Yes or No if my conclusion matches yours.

Sjef, I thought you concluded correctly that a ViewEntry is present in both the cases. Now c'mon, don't say that i need to explain each and everything to likes of you, like saying "yes please" or "hell no" for everything. When are you going to decide to grow up?

Okay, Partha was about to share how it differes in case of a Notes Client agent Vs Web Client agent Vs Scheduled agent. I am all ears. Are you?

Meantime, in my testings, an agent is able to export to Excel a view with about a dozen columns selecting 4500 documents with an activity log in about 130-135 seconds. There isn't much difference bw the time taken when it runs locally as a manual agent and when it runs on a server as scheduled. Is this okay? Or can it be tweaked further?

RAPUTA, if anything, Sjef will not agree to that. Why not post many questions and give him more opportunity to earn points? I would love what you want, but Sjef will not give the link, bet with me.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12090908
Is a decision required to start growing up? Great. I'll never grow up, if it's up to me. If you see what all the grown-up people in the world are doing to each other... I don't want to be part of that.

And about the on-line resource: qwaletee seems to qualify. What he knows about the internals of Notes is considerable. I'd love to have some serious Notes documentation as well, it just isn't there if you haven't been there. Proprietary, I assume. If I had the link, would I share it? If I say I don't have that link or documentation, would you believe me?

By the way, did you test your agent for both cases with 1000, 2000, 3000 etc documents? The effects that are not document related must be eliminated from your timing results. Maybe, just maybe, I'll build a test agent over here, to see what the results are.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 19

Author Comment

by:RanjeetRain
ID: 12091355
Did you check out your profiles? Use new look (vs old look) and click on a certificate u have :)

OR see this: http://experts-exchange.com/certificate.jsp?taid=133
0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12091359
Qwaletee is a good resource to have. Now someone who has his phone number pls call him and ask to participate here.. lol. Seriously, his knowledge of Domino is admirable. I guess he has not been here much these days.

Good to know you intend to do some testing. I am doing too. Lets post our results. This may just turn out to be an official benchmark of domino's performance ;)
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12116859
Ranjeet
How do i see the oldlook for the certificate. Doesn't seem to work..

Partha
0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12116883
It doesn't work on old look Partha. Just click the link I posted and you are there. To see other certs that you have replace the TA prog ID.

Oh, btw, I am still awaiting more of your comments.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12116891
Ranjeet,
May be i can send u a email, it's more of a coding practice rather than a explanation.

Partha
0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12116931
Sure send. You need my permission to send me a mail or what?

But if you send me a mail don't expect points for them (Sjef is watching).
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 12120090
The certificate is C-O-O-L .  I'm sure I'll print it out and hang over my desk :-)

But seriously, check out the martin scott website, they have a report on Domino performance (several functions compared).  Also in the Performance zone on LDD, there are some documents regarding 'fast' code, although they may be a bit 'low' level for you ...

cheers,

Tom
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12120568
'low' level... LOL!

Partha: Big Brother (6'5") is watching you...

Sjef ;)
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12122009
Tom
Even i liked the certificate,but most of them dont come intheir original names here, shdnt there be a option to change the name (or did i miss it !)

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12122220
Wouldn't that be great! I'd look for one of the millionaires, open a certificate of my liking and change my name. Splendid.

An option would be to ask the EE guys to use the proper name when you allowed your proper name to be shown to the EE-community. You could switch it on, get and print your profile, and switch it off again.
0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12122755
Okay Tom, I'll check them. Hope to get something to learn.

Sjef? 6'5"!!?!! Are you sure you are not bragging :D


EE people need a kick to get started.

IF FIRST_NAME <> "" AND LAST_NAME <> "" THEN
   DISPLAY_NAME = FIRST_NAME & " " & LAST_NAME
ELSE
   DISPLAY_NAME = USER_ID
END IF


Please post this as an advice in Experts input.
0
 
LVL 19

Author Comment

by:RanjeetRain
ID: 12189048
OKay, Partha doesn't want to send me the docs that he said he would. Busy.. huh!!

ANybody wants to add something before i close this?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12189321
I rest my case, your honour.
0
 
LVL 6

Expert Comment

by:platinumbay
ID: 12661935
I don't understand what the problem is with forging, won't that information be verifiable on this site anyway?
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now