- Optimize DB
- The first db:replace() via RESTXQ creates a second file with the same
base-uri()
- The second db:replace() via RESTXQ replaces the earlier created second
file (duplicate)
Do you perform the next steps in the database instance that has been copied to another server, or does the problem also happen on the original instance? In the first case, do both servers use the same operating system (either Linux or Windows)?
Should I try to optimize the database with 9.1.2 before copying and try
again?
Definitely worth trying. If you export your data and create a new database with 9.2.x, and if the problem persists, we could have a look at it.
this is a database-structure related issue?
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen@gmail.com] Gesendet: Montag, 29. April 2019 16:00 An: Zimmel, Daniel Cc: BaseX Betreff: Re: [basex-talk] db:replace() in DBA resulting in duplicates
Still, when I browse the database, the /DB/path only exists once (as
far as I can
see from the sorting), but querying is giving me two documents,
according to
db:path() living in the same path.
This should never happen, should it?
This is surprising indeed.
Right now, db:add is still faster than db:replace, because the check for existing database paths can be completely skipped. This allows high-performance database insertions.In a future version of BaseX, I would love to get rid of db:add and db:replace and replace these functions with a db:update function, which will enforce that each document path exists only once in the database. This would surely reduce patterns like the one you encountered.
If you still manage to get this reproduced, just come back to us.