Question from a reader (XPages-related)... How does Notes get a document by NoteID?
Category IBM XPages
I received a question in my email the other day, and I wanted to open it up to the XPages community. I think that the answer from a Notes client perspective might not be the correct answer given the XPages angle. Feel free to leave comment(s)...
The question is: How does Notes get a document by NoteID?
It seems to me that it takes the NoteID and then compares it to each value in an internal list (index?) until it finds the document. This approach works fine if the database is small. However....I have a client that runs a database containing one million documents. Even at this extreme the user must only wait a second or two for the document to be found and opened, So it is still within acceptable limits. The fun really starts when you have an XPages repeat control that displays data from sixty documents. This XPage can take TWO MINUTES to open! Not so acceptable
I'm sure you know that the repeat control gets documents by NoteID to display. So the Domino server is receiving a list of sixty NoteIDs to find in the database. Now if the NoteIDs were represented in, for example, a B-Tree data structure then it would take only six matches or so to find each document. Instead it seems very much like the server is trying to find each one in a very long list.
I have gotten around the problem by moving the XPages application (including the documents accessed by the repeat control) to a smaller database. This is a bit kludgy but responds very fast to the user. But I'd still like to get some closure with this issue. I'd like to know what really happens in the black-box-that-is-Domino when you ask it to get a doc by ID. So far the IBM people that I've hit with this question have run away and hid. Not very helpful so all I can say now is......
help me Obi-Wan, you're my only hope
cheers
I received a question in my email the other day, and I wanted to open it up to the XPages community. I think that the answer from a Notes client perspective might not be the correct answer given the XPages angle. Feel free to leave comment(s)...
The question is: How does Notes get a document by NoteID?
It seems to me that it takes the NoteID and then compares it to each value in an internal list (index?) until it finds the document. This approach works fine if the database is small. However....I have a client that runs a database containing one million documents. Even at this extreme the user must only wait a second or two for the document to be found and opened, So it is still within acceptable limits. The fun really starts when you have an XPages repeat control that displays data from sixty documents. This XPage can take TWO MINUTES to open! Not so acceptable
I'm sure you know that the repeat control gets documents by NoteID to display. So the Domino server is receiving a list of sixty NoteIDs to find in the database. Now if the NoteIDs were represented in, for example, a B-Tree data structure then it would take only six matches or so to find each document. Instead it seems very much like the server is trying to find each one in a very long list.
I have gotten around the problem by moving the XPages application (including the documents accessed by the repeat control) to a smaller database. This is a bit kludgy but responds very fast to the user. But I'd still like to get some closure with this issue. I'd like to know what really happens in the black-box-that-is-Domino when you ask it to get a doc by ID. So far the IBM people that I've hit with this question have run away and hid. Not very helpful so all I can say now is......
help me Obi-Wan, you're my only hope
cheers



Comments
Posted by null At 00:14:34 On 20/11/2012 | - Website - |
Sounds like there is no index on this database.
Stephan Wissel has some comments on this:
{ Link }
Posted by Wayne At 05:03:25 On 20/11/2012 | - Website - |
Posted by Thomas Duff At 05:08:46 On 20/11/2012 | - Website - |
Posted by jeremy hodge At 06:23:34 On 20/11/2012 | - Website - |
Posted by roubech At 11:02:53 On 21/11/2012 | - Website - |
There are no reader/authors fields.
The database is indexed.
The way that the noteids are provided to the repeat control is not relevant. This can be put in as a static list so it *cant* take any time. It's when the system heads off to get the document by noteid that the time starts ticking away. It's easy to try this for yourself. Create an empty test db. Create a form called "X" and a view and create 60 documents. Create XPage with a repeat control that accesses data from all 60 documents. See that it opens instantly. Now create a new form called "Y". Then run something like this:
dim doc as notesdocument
dim i as long
for i = 1 to 999999
set doc = db.CreateDocument
doc.Form = "Y"
doc.DummyNumber = i
doc.Title = "dummy doc"
call doc.Save(true, false, true)
next
Now watch paint dry as your XPage opens
Posted by Dale Manolas At 23:37:45 On 29/01/2013 | - Website - |