Search code examples
kdb

How do I unload a kdb partitioned database?


I loaded (mapped) a partitioned database with the \l command. How can I unmap the database? This can be useful for a number of reasons, like loading a different db with the same name or freeing some system memory.


Solution

  • There is no command to do this. You could manually delete all the variables that were created when the database was mapped. So delete sym, date (if your database contains a date partitioned table) and all the tables that were loaded.

    / delete sym, date, quote and trade from the default namespace
    delete sym, date, quote, trade from `.
    
    / or if you want to delete everything in the default namespace
    delete from `.
    

    After doing this you could call .Q.gc[] - to return memory to the os. Not pretty, but I think it's the only way.