Michael, Welcome to the list.
One thing you could try immediately is to call OPTIMIZE – possibly followed by the ALL flag, or db:optimize(..., true() – and see if performance improves. Obviously, this doesn't make sense after each single update operation, but it could be called before a bigger number of updates is to be performed. > The problem is that in my case, I have to do about 150000 inserts and deletes, so it would take too much time. If you define all the insert expression (or a bigger number than just 1 or 10) in a single XQuery expression (via a FLWOR expression), you will benefit from various bulk optimizations. Did you try that already? Best, Christian BIRKNER Michael <michael.birk...@akwien.at> schrieb am Mi., 8. Aug. 2018, 08:36: > Hello, > > > I asked this question in StackOverflow concerning some performance > problems I experienced when inserting nodes into a BaseX database: > > https://stackoverflow.com/questions/51595210/basex-inserting-nodes-performance-problems > > I already made some progress, especially when it comes to querying all > data I need for the updates. I work a lot with the indexes now. > > But I still have problems with inserting - and also deleting - nodes. It > doesn't matter if I insert/delete nodes via a Java program or in the editor > of the BaseX GUI: Both is quite slow. Inserting just one node in the GUI > with an XQuery like this one takes up to 3 seconds: > > insert node <related_record><title>Test title</title><author>Joe > Lastname</author></related_record> into db:open-id('Database_Name', 7947561) > > Deleting a node with the following command takes up to 7 seconds: > delete node db:open-id('Database_Name', 88085737) > > The problem is that in my case, I have to do about 150000 inserts and > deletes, so it would take too much time. > > Maybe my database is just too big to be performant? Or some settings are > wrong? I'm very new to BaseX (and XML databases in general) so maybe there > are just some errors I don't see. I also give you some information on my > database that I copied from the info screen of the BaseX GUI: > > > Database Properties > NAME: Database_Name > SIZE: 2568 MB > NODES: 135607105 > DOCUMENTS: 1 > BINARIES: 0 > TIMESTAMP: 2018-08-07T07:05:56.000Z > UPTODATE: true > > Resource Properties > INPUTPATH: /path/to/file.xml > INPUTSIZE: 1774 MB > INPUTDATE: 2018-07-24T14:32:58.000Z > > Indexes > TEXTINDEX: true > ATTRINDEX: true > TOKENINDEX: false > FTINDEX: false > TEXTINCLUDE: > ATTRINCLUDE: > TOKENINCLUDE: > FTINCLUDE: > LANGUAGE: English > STEMMING: false > CASESENS: false > DIACRITICS: false > STOPWORDS: > UPDINDEX: true > AUTOOPTIMIZE: false > MAXCATS: 100 > MAXLEN: 96 > SPLITSIZE: 0 > > Best regards, > Michael > > Beachten Sie, dass Sie uns ab sofort unter einer geänderten Rufnummer > erreichen. Bitte speichern Sie gleich Ihren Kontakt zur AK Wien ein unter *501 > 65 1*, gefolgt von der gewohnten Durchwahl. > Dieses Mail ist ausschließlich für die Verwendung durch die/den darin > genannten AdressatInnen bestimmt und kann vertrauliche bzw rechtlich > geschützte Informationen enthalten, deren Verwendung ohne Genehmigung durch > den/ die AbsenderIn rechtswidrig sein kann. Falls Sie dieses Mail > irrtümlich erhalten haben, informieren Sie uns bitte und löschen Sie die > Nachricht. UID: ATU 16209706 I > https://wien.arbeiterkammer.at/Datenschutz_(DSGVO).html >