Das Notes Forum

Domino 9 und frühere Versionen => ND8: Entwicklung => Thema gestartet von: Dubidu am 23.02.09 - 09:02:15

Titel: Antwort-Dokumente performancelastig?
Beitrag von: Dubidu am 23.02.09 - 09:02:15
Hallo,
sind eigentlich Antwortdokumente/Response Documents eigentlich performancelastig?
Ich würde gerne für ein Dokument mehrere tausend Antwortdokumente erzeugen und dann ggf. die Antwortdokumente abfragen.

Liebe Grüße
Giordano
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: Thomas Schulte am 23.02.09 - 09:19:53
Warum willst du das?

Die Antwort ist, das hängt davon ab.
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: Dubidu am 23.02.09 - 09:32:29
Warum willst du das?

Aus Komfortgründen. Um ein Elterndokument und die dazugehörigen Antwortdokumenten einerseits in einer View anzuzeigen, andererseits im Code einfach die Antwortdokumente der Elterndokumente zu holen.

Liebe Grüße
Giordano
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: Dubidu am 23.02.09 - 13:00:00
Die Antwort ist, das hängt davon ab.

Von was hängt das nun ab?

Liebe Grüße
Giordano
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: m3 am 23.02.09 - 13:01:34
Wovon, nicht "von was". ;)

Anzahl der Dokumente, Anzahl & Komplexität der Views, ob es Reader/Autorenfelder in den Dokumenten gibt, wie auf die Antwortdokumente zugreifst, ...
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: m3 am 23.02.09 - 13:09:00
Nachtrag:
Zitat
Don't support specialized response hierarchy

The Don't support specialized response hierarchy option allows your application to take advantage of the specialized response @formulas: @AllChildren and @AllDescendents. These functions allow you to build views based on specific criteria for parent documents and all of their response documents. Let's take for example a discussion database with 10,000 main topics and 100,000 response documents. Suppose you create a handful of views that show just certain categories, like Application Performance. If only 100 main topics are categorized this way, you may anticipate that the view would show those 100 main topics, plus all of their responses (and response to response documents and so on). Traditionally, Notes has relied upon a Selection formula such as:

SELECT (Form = "Main Topic" & Categories =
"Application Development") | @IsResponseDoc


Unfortunately, this formula gives you all 100,000 response documents. You presumably wouldn't see most of them because your view will have a response hierarchy. But they are all there, slowing down your view indexing and taking up disk space. If you allow a specialized response hierarchy (enabled in Release 4, and optional in Release 5 and Notes/Domino 6), then you can use a slightly different formula:

SELECT (Form = "Main Topic" & Categories =
"Application Development") | @AllDescendants


This formula gives you the exact set of documents you seek, so your view indexing and disk space requirements are minimized.

So far, we've only told you why you should enable this feature (that is, leave the option unchecked). But if your application has no use for formulas that use @AllChildren or @AllDescendants, then there is no reason for the program to maintain this information, so you can save processing cycles by selecting the Don't support specialized response hierarchy option to disable the specialized response hierarchy.
aus Application Performance Tuning, Part 1 (http://www.ibm.com/developerworks/lotus/library/ls-AppPerfpt1/)
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: Dubidu am 23.02.09 - 17:55:51
Hi M3,
danke, das ist ein Anfang.

Gibt es einen Performance-Unterschied zwischen doc.Responses und view.GetAllDocumentsByKey?

Ist ersteres schneller?

Liebe Grüße
Giordano

PS: Ich bräuchte in beiden Fällen, dann aufjedenfall alle Dokumente!
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: koehlerbv am 23.02.09 - 18:32:29
Ich bräuchte in beiden Fällen, dann aufjedenfall alle Dokumente!

Das irritiert jetzt sicherlich nicht nur mich: Du brauchst ALLE Dokumente? Dazu sind ja beide Verfahren ungeeignet.

Deine Frage beantworte ich daher nur "rein theoretisch": Der Zugriff auf Response Documents erfolgt via UNID und ist daher das zweitschnellste Verfahren zum Dokumentenzugriff überhaupt.
Der Zugriff über einen View Index ist ebenfalls sehr, sehr schnell, bleibt aber hinter NotesDocument.Responses zurück.

Es kommt nun also darauf an, wann man den Zugriff braucht - eine Schleife über 10.000 Hauptdokumente, dann zählt der Geschwindigkeitsvorteil. Sind es deutlich weniger, dann kannst Du das Verfahren auch auswürfeln.

HTH,
Bernhard
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: Dubidu am 24.02.09 - 08:48:47
Ich bräuchte in beiden Fällen, dann aufjedenfall alle Dokumente!

Das irritiert jetzt sicherlich nicht nur mich: Du brauchst ALLE Dokumente? Dazu sind ja beide Verfahren ungeeignet.

Nicht alle Dokumente in der Datenbank, sondern alle Dokumente die dann über Responses/GetAllDocumentsByKey zurückgegeben werden.

Zitat
Deine Frage beantworte ich daher nur "rein theoretisch": Der Zugriff auf Response Documents erfolgt via UNID und ist daher das zweitschnellste Verfahren zum Dokumentenzugriff überhaupt.
Der Zugriff über einen View Index ist ebenfalls sehr, sehr schnell, bleibt aber hinter NotesDocument.Responses zurück.

Es kommt nun also darauf an, wann man den Zugriff braucht - eine Schleife über 10.000 Hauptdokumente, dann zählt der Geschwindigkeitsvorteil. Sind es deutlich weniger, dann kannst Du das Verfahren auch auswürfeln.

Es sind sogar über 10 000 Dokumente. Was wäre denn das schnellste Verfahren, wenn ich fragen darf? NotesDatabase.AllDocuments und dann iterieren?

Liebe Grüße
Giordano
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: TRO am 24.02.09 - 09:01:25
Zitat

.... Was wäre denn das schnellste Verfahren, wenn ich fragen darf? NotesDatabase.AllDocuments und dann iterieren?

Liebe Grüße
Giordano

Der Zugriff mittels NoteID, also db.GetDocumentByID. (ist aber in Deinem Fall nicht brauchbar)


Thomas
Titel: Re: Antwort-Dokumete performancelastig?
Beitrag von: Dubidu am 24.02.09 - 10:19:00
OK, THX! :)

Liebe Grüße
Giordano