2019-05-11 23:15:14 +02:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#define HAVE_IRCD_M_DBS_EVENT_COLUMN_H
|
|
|
|
|
2019-08-21 04:44:00 +02:00
|
|
|
// These columns all store duplicate data from the original _event_json
|
|
|
|
// but limited to a single specific property. The index key is an event_idx
|
|
|
|
// (just like _event_json). These columns are useful for various optimizations
|
|
|
|
// at the cost of the additional space consumed.
|
|
|
|
|
2019-05-11 23:15:14 +02:00
|
|
|
namespace ircd::m::dbs
|
|
|
|
{
|
|
|
|
// Event property column max-count. The number of event columns may be
|
|
|
|
// less by not initializing positions in the event_column array.
|
|
|
|
constexpr const auto event_columns
|
|
|
|
{
|
|
|
|
event::size()
|
|
|
|
};
|
|
|
|
|
2023-02-11 04:43:00 +01:00
|
|
|
void _index_event_cols(db::txn &, const event &, const opts &);
|
2020-03-25 19:06:29 +01:00
|
|
|
|
2019-08-21 04:44:00 +02:00
|
|
|
// There is one position in this array corresponding to each property
|
|
|
|
// in the m::event tuple, however, the db::column in this position may
|
|
|
|
// be default-initialized if this column is not used.
|
2019-05-11 23:15:14 +02:00
|
|
|
extern std::array<db::column, event_columns> event_column;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ircd::m::dbs::desc
|
|
|
|
{
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> _event__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> _event__bloom__bits;
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> content__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> content__block__size;
|
|
|
|
extern conf::item<size_t> content__meta_block__size;
|
|
|
|
extern conf::item<size_t> content__cache__size;
|
|
|
|
extern conf::item<size_t> content__cache_comp__size;
|
2021-01-12 22:51:02 +01:00
|
|
|
extern conf::item<size_t> content__file__size__max;
|
2022-07-30 05:34:44 +02:00
|
|
|
extern conf::item<size_t> content__compaction_trigger;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern const db::descriptor content;
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> depth__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> depth__block__size;
|
|
|
|
extern conf::item<size_t> depth__meta_block__size;
|
|
|
|
extern conf::item<size_t> depth__cache__size;
|
|
|
|
extern conf::item<size_t> depth__cache_comp__size;
|
|
|
|
extern const db::descriptor depth;
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> event_id__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> event_id__block__size;
|
|
|
|
extern conf::item<size_t> event_id__meta_block__size;
|
|
|
|
extern conf::item<size_t> event_id__cache__size;
|
|
|
|
extern conf::item<size_t> event_id__cache_comp__size;
|
|
|
|
extern const db::descriptor event_id;
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> origin_server_ts__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> origin_server_ts__block__size;
|
|
|
|
extern conf::item<size_t> origin_server_ts__meta_block__size;
|
|
|
|
extern conf::item<size_t> origin_server_ts__cache__size;
|
|
|
|
extern conf::item<size_t> origin_server_ts__cache_comp__size;
|
|
|
|
extern const db::descriptor origin_server_ts;
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> room_id__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> room_id__block__size;
|
|
|
|
extern conf::item<size_t> room_id__meta_block__size;
|
|
|
|
extern conf::item<size_t> room_id__cache__size;
|
|
|
|
extern conf::item<size_t> room_id__cache_comp__size;
|
|
|
|
extern const db::descriptor room_id;
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> sender__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> sender__block__size;
|
|
|
|
extern conf::item<size_t> sender__meta_block__size;
|
|
|
|
extern conf::item<size_t> sender__cache__size;
|
|
|
|
extern conf::item<size_t> sender__cache_comp__size;
|
|
|
|
extern const db::descriptor sender;
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> state_key__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> state_key__block__size;
|
|
|
|
extern conf::item<size_t> state_key__meta_block__size;
|
|
|
|
extern conf::item<size_t> state_key__cache__size;
|
|
|
|
extern conf::item<size_t> state_key__cache_comp__size;
|
|
|
|
extern const db::descriptor state_key;
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> type__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> type__block__size;
|
|
|
|
extern conf::item<size_t> type__meta_block__size;
|
|
|
|
extern conf::item<size_t> type__cache__size;
|
|
|
|
extern conf::item<size_t> type__cache_comp__size;
|
|
|
|
extern const db::descriptor type;
|
2019-05-11 23:15:14 +02:00
|
|
|
}
|