build(repo): structure the repo into postgresql subdirectory with separate template and internal tests
This commit is contained in:
8
postgresql/README.md
Normal file
8
postgresql/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# PostgreSQL Partitioning for Zabbix
|
||||||
|
|
||||||
|
This directory contains solutions for partitioning a Zabbix database running on PostgreSQL. Partitioning is essential for large Zabbix environments as it eliminates the need for the built-in Zabbix Housekeeper to aggressively delete old data row-by-row, replacing it with instant DDL operations that drop entire daily or monthly chunks.
|
||||||
|
|
||||||
|
## Implementations
|
||||||
|
|
||||||
|
- **[procedures](procedures/)**: The recommended Declarative (SQL-based) implementation. It uses native PostgreSQL procedures and features like `pg_cron` for entirely self-contained maintenance.
|
||||||
|
- **[script](script/)**: External script-based management solution. (Coming soon)
|
||||||
3
postgresql/script/README.md
Normal file
3
postgresql/script/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Script-based Partitioning
|
||||||
|
|
||||||
|
(Coming soon)
|
||||||
@@ -67,17 +67,17 @@ if [[ -f "$SQL_DIR/schema.sql" ]]; then
|
|||||||
cp "$SQL_DIR/schema.sql" ./init_scripts/01_00_schema.sql
|
cp "$SQL_DIR/schema.sql" ./init_scripts/01_00_schema.sql
|
||||||
|
|
||||||
# 1.1 Partitioning Infrastructure
|
# 1.1 Partitioning Infrastructure
|
||||||
if [[ -f "../procedures/00_schema_create.sql" ]]; then
|
if [[ -f "../../procedures/00_schema_create.sql" ]]; then
|
||||||
cp "../procedures/00_schema_create.sql" ./init_scripts/01_10_schema_create.sql
|
cp "../../procedures/00_schema_create.sql" ./init_scripts/01_10_schema_create.sql
|
||||||
fi
|
fi
|
||||||
if [[ -f "../procedures/01_maintenance.sql" ]]; then
|
if [[ -f "../../procedures/01_maintenance.sql" ]]; then
|
||||||
cp "../procedures/01_maintenance.sql" ./init_scripts/01_30_maintenance.sql
|
cp "../../procedures/01_maintenance.sql" ./init_scripts/01_30_maintenance.sql
|
||||||
fi
|
fi
|
||||||
if [[ -f "../procedures/02_enable_partitioning.sql" ]]; then
|
if [[ -f "../../procedures/02_enable_partitioning.sql" ]]; then
|
||||||
cp "../procedures/02_enable_partitioning.sql" ./init_scripts/01_40_enable.sql
|
cp "../../procedures/02_enable_partitioning.sql" ./init_scripts/01_40_enable.sql
|
||||||
fi
|
fi
|
||||||
if [[ -f "../procedures/03_monitoring_view.sql" ]]; then
|
if [[ -f "../../procedures/03_monitoring_view.sql" ]]; then
|
||||||
cp "../procedures/03_monitoring_view.sql" ./init_scripts/01_50_monitoring.sql
|
cp "../../procedures/03_monitoring_view.sql" ./init_scripts/01_50_monitoring.sql
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "${RED}Error: schema.sql not found in $SQL_DIR${NC}"
|
echo -e "${RED}Error: schema.sql not found in $SQL_DIR${NC}"
|
||||||
Reference in New Issue
Block a user