QuestDB在其 root_directory 下创建如下文件结构:
questdb
├── conf
├── db
├── log
└── public
conf 目录
包含QuestDB的配置文件:
├── conf
│ ├── date.formats
│ ├── mime.types
│ └── server.conf
file | description |
---|---|
date.formats | A list of date formats in plain text. |
mime.types | Mapping file used by the HTTP server to map file extension to response type when an user downloads a file. |
server.conf | Server configuration file. Find out more in the server configuration section. |
db 目录
此目录包含与数据库表相关的所有文件。它的组织如下:
- 每个表在root_directory/db/table_name下都有自己的table_directory
- 在一个table_directory中,每个分区都有自己的partition_directory。
- 在每个分区目录中,每个列都有自己的column_file,例如mycolumn.d
- 如果给定的列有一个索引,那么也会有一个index_file,例如mycolumn.k
该表还将元数据存储在 _meta 文件中:
├── db
│ ├── Table
│ │ │
│ │ ├── Partition 1
│ │ │ ├── _archive
│ │ │ ├── column1.d
│ │ │ ├── column2.d
│ │ │ ├── column2.k
│ │ │ └── ...
│ │ ├── Partition 2
│ │ │ ├── _archive
│ │ │ ├── column1.d
│ │ │ ├── column2.d
│ │ │ ├── column2.k
│ │ │ └── ...
│ │ │
│ │ ├── _meta
│ │ └── _txn
│ └── table_1.lock
如果表没有分区,数据存储在一个名为 default 的目录中:
├── db
│ ├── Table
│ │ │
│ │ ├── default
│ │ │ ├── _archive
│ │ │ ├── column1.d
│ │ │ ├── column2.d
│ │ │ ├── column2.k
│ │ │ └── ...
│ │ ├── _meta
│ │ └── _txn
│ └── table_1.lock
警告
尽管通过手动删除文件系统中的目录来删除分区可能很诱人,但我们确实不鼓励这样做。分区是用元数据组织的,直接删除它们可能会破坏表。我们建议您使用ALTER TABLE DROP PARTITION来达到这个效果。
log 目录
包含QuestDB的日志文件:
├── log
│ ├── stdout-2020-04-15T11-59-59.txt
│ └── stdout-2020-04-12T13-31-22.txt
日志文件看起来像这样:
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 目录
包含web控制台的web文件:
└── public
├── assets
│ ├── console-configuration.json
│ └── favicon.png
├── index.html
├── qdb.js
├── qdb.css
└── ...