Root directory structure

QuestDB creates the following file structure in its root_directory:

questdb
โ”œโ”€โ”€ conf
โ”œโ”€โ”€ db
โ”œโ”€โ”€ log
โ”œโ”€โ”€ public
โ””โ”€โ”€ snapshot (optional)

By default, QuestDB's root directory will be the following:

$HOME/.questdb

conf directory#

Contains configuration files for QuestDB:

โ”œโ”€โ”€ conf
โ”‚ย ย  โ”œโ”€โ”€ date.formats
โ”‚ย ย  โ”œโ”€โ”€ mime.types
โ”‚ย ย  โ””โ”€โ”€ server.conf
filedescription
date.formatsA list of date formats in plain text.
mime.typesMapping file used by the HTTP server to map file extension to response type when an user downloads a file.
server.confServer configuration file. Find out more in the server configuration section.

db directory#

This directory contains all the files related to database tables. It is organised as follows:

  • Each table has its own table_directory under root_directory/db/table_name
  • Within a table_directory, each partition has its own partition_directory.
  • Within each partition directory, each column has its own column_file, for example mycolumn.d
  • If a given column has an index, then there will also be an index_file, for example mycolumn.k

The table also stores metadata in _meta files:

โ”œโ”€โ”€ db
โ”‚ย ย  โ”œโ”€โ”€ Table
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย 
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Partition 1
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _archive
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column1.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.k
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ ...
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Partition 2
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _archive
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column1.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.k
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ ...
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย 
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _meta
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _txn
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ _cv
โ”‚ย ย  โ””โ”€โ”€ table_1.lock

If the table is not partitioned, data is stored in a directory called default:

โ”œโ”€โ”€ db
โ”‚ย ย  โ”œโ”€โ”€ Table
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย 
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ default
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _archive
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column1.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.k
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ ...
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _meta
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ _txn
โ”‚ย ย  โ””โ”€โ”€ table_1.lock

For a WAL table, the table structure contains one or more wal folders and a seq folder representing the Sequencer:

โ”œโ”€โ”€ db
โ”‚ย ย  โ”œโ”€โ”€ Table
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย 
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Partition 1
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _archive
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column1.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.k
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ ...
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Partition 2
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _archive
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column1.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.k
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ ...
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ txn_seq
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _meta
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _txnlog
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ _wal_index.d
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ wal1
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 0
โ”‚ย ย  โ”‚ย ย  โ”‚ ย  โ”œโ”€โ”€ _meta
โ”‚ย ย  โ”‚ย ย  โ”‚ ย  โ”œโ”€โ”€ _event
โ”‚ย ย  โ”‚ย ย  โ”‚ ย  โ”œโ”€โ”€ column1.d
โ”‚ย ย  โ”‚ย ย  โ”‚ ย  โ”œโ”€โ”€ column2.d
โ”‚ย ย  โ”‚ย ย  โ”‚ โ””โ”€โ”€ ...
| | |ย 
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ wal2
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 0
โ”‚ย ย  โ”‚ย ย  โ”‚ โ”‚ย  โ”œโ”€โ”€ _meta
โ”‚ย ย  โ”‚ย ย  โ”‚ โ”‚ย  โ”œโ”€โ”€ _event
โ”‚ย ย  โ”‚ย ย  โ”‚ โ”‚ย  โ”œโ”€โ”€ column1.d
โ”‚ย ย  โ”‚ย ย  โ”‚ โ”‚ย  โ”œโ”€โ”€ column2.d
โ”‚ย ย  โ”‚ย ย  โ”‚ โ”‚ย  โ””โ”€โ”€ ...
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 1
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  ย ย  โ”œโ”€โ”€ _meta
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _event
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column1.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ column2.d
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ ...
โ”‚ย ย  โ”‚ย ย  โ”‚ย 
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _meta
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ _txn
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ _cv
โ”‚ย ย  |
caution

As tempting as it may be to delete partitions by manually removing the directories from the file system, we really discourage this. The partitions are organised with metadata and deleting them directly could corrupt the table. We recommend you use ALTER TABLE DROP PARTITION for this effect.

log directory#

Contains the log files for QuestDB:

โ”œโ”€โ”€ log
โ”‚ย ย  โ”œโ”€โ”€ stdout-2020-04-15T11-59-59.txt
โ”‚ย ย  โ””โ”€โ”€ stdout-2020-04-12T13-31-22.txt

Log files look like this:

2020-04-15T16:42:32.879970Z I i.q.c.TableReader new transaction [txn=2, transientRowCount=1, fixedRowCount=1, maxTimestamp=1585755801000000, attempts=0]
2020-04-15T16:42:32.880051Z I i.q.g.FunctionParser call to_timestamp('2020-05-01:15:43:21','yyyy-MM-dd:HH:mm:ss') -> to_timestamp(Ss)
2020-04-15T16:42:32.880657Z I i.q.c.p.WriterPool >> [table=`table_1`, thread=12]
2020-04-15T16:42:32.881330Z I i.q.c.AppendMemory truncated and closed [fd=32]
2020-04-15T16:42:32.881448Z I i.q.c.AppendMemory open /usr/local/var/questdb/db/table_1/2020-05/timestamp.d [fd=32, pageSize=16777216]
2020-04-15T16:42:32.881708Z I i.q.c.AppendMemory truncated and closed [fd=33]
2020-04-15T16:42:32.881830Z I i.q.c.AppendMemory open /usr/local/var/questdb/db/table_1/2020-05/temperature.d [fd=33, pageSize=16777216]
2020-04-15T16:42:32.882092Z I i.q.c.AppendMemory truncated and closed [fd=34]
2020-04-15T16:42:32.882210Z I i.q.c.AppendMemory open /usr/local/var/questdb/db/table_1/2020-05/humidity.d [fd=34, pageSize=16777216]
2020-04-15T16:42:32.882248Z I i.q.c.TableWriter switched partition to '/usr/local/var/questdb/db/table_1/2020-05'
2020-04-15T16:42:32.882571Z I i.q.c.p.WriterPool << [table=`table_1`, thread=12]
2020-04-15T16:44:33.245144Z I i.q.c.AppendMemory truncated and closed [fd=32]
2020-04-15T16:44:33.245418Z I i.q.c.AppendMemory truncated and closed [fd=33]
2020-04-15T16:44:33.245712Z I i.q.c.AppendMemory truncated and closed [fd=34]
2020-04-15T16:44:33.246096Z I i.q.c.ReadWriteMemory truncated and closed [fd=30]
2020-04-15T16:44:33.246217Z I i.q.c.ReadOnlyMemory closed [fd=31]
2020-04-15T16:44:33.246461Z I i.q.c.TableWriter closed 'table_1'
2020-04-15T16:44:33.246492Z I i.q.c.p.WriterPool closed [table=`table_1`, reason=IDLE, by=12]
2020-04-15T16:44:33.247184Z I i.q.c.OnePageMemory closed [fd=28]
2020-04-15T16:44:33.247239Z I i.q.c.ReadOnlyMemory closed [fd=27]
2020-04-15T16:44:33.247267Z I i.q.c.TableReader closed 'table_1'
2020-04-15T16:44:33.247287Z I i.q.c.p.ReaderPool closed 'table_1' [at=0:0, reason=IDLE]
2020-04-15T16:44:39.763406Z I http-server disconnected [ip=127.0.0.1, fd=24]
2020-04-15T16:44:39.763729Z I i.q.c.h.HttpServer pushed

public directory#

Contains the web files for the Web Console:

โ””โ”€โ”€ public
โ”œโ”€โ”€ assets
โ”‚ย ย  โ”œโ”€โ”€ console-configuration.json
โ”‚ย ย  โ””โ”€โ”€ favicon.webp
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ qdb.js
โ”œโ”€โ”€ qdb.css
โ””โ”€โ”€ ...

snapshot directory#

Created when a filesystem (disk) snapshot is collected. Contains table metadata file copies.

tmp directory#

Created when a COPY SQL command is run for a partitioned table and no value is set for the cairo.sql.copy.work.root configuration setting. Contains temporary import files like indexes or temporary partitions.


โญ Something missing? Page not helpful? Please suggest an edit on GitHub.