Changes

Jump to navigation Jump to search
397 bytes added ,  12:51, 1 August 2022
=Main-Memory Databases=
A database can be created in main-memory by enabling the {{Option|MAINMEM}} option. Next,in the standalone context, a main-memory database can be created, which can then be accessed by subsequent commands.
* in the standalone context, a main-memory database can be created, which can then be accessed by subsequent commands.* If a BaseX server instance is started, and if a database is created in its context at startup time, e.g., with the [[Command-Line Options|command-line option -c]] and a {{Command|CREATE DB}} call. , BaseX clients can then access and update this database: <syntaxhighlight lang="perl"># Serverbasexserver -c"SET mainmem on" -c"CREATE DB mainmem document.xml"BaseX [Server]Server was started (port: 1984).MAINMEM: trueDatabase 'mainmem' created in 1782.80 ms. # ClientbasexclientUsername: ...Password: ...BaseX [Client]Try 'help' to get more information.> XQUERY count(db:get('mainmem')//*)1876462Query executed in 0.97 ms.</syntaxhighlight> Additional notes:
* You can force an ordinary database, or parts of it, to being temporarily copied to memory by applying an empty [[XQuery_Update#Main-Memory_Updates|main-memory update]] on a database node: <code>db:get('some-db') update { }</code>
 '''Note:''' * If you open local or remote documents with <code>fn:doc</code> or <code>fn:collection</code>, the resulting internal representation is identical to those of main-memory database instances (regardless of which value is set for {{Option|MAINMEM}}).
=Changelog=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu