Improve docker config
This commit is contained in:
26
infrastructure/postgres/init-scripts/init.sql
Normal file
26
infrastructure/postgres/init-scripts/init.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
-- Create extensions for all databases
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
CREATE EXTENSION IF NOT EXISTS "pg_stat_statements";
|
||||
CREATE EXTENSION IF NOT EXISTS "pg_trgm";
|
||||
|
||||
-- Create Spanish collation for proper text sorting
|
||||
-- This will be used for bakery names, product names, etc.
|
||||
-- CREATE COLLATION IF NOT EXISTS spanish (provider = icu, locale = 'es-ES');
|
||||
|
||||
-- Set timezone to Madrid
|
||||
SET timezone = 'Europe/Madrid';
|
||||
|
||||
-- Performance tuning for small to medium databases
|
||||
ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements';
|
||||
ALTER SYSTEM SET max_connections = 100;
|
||||
ALTER SYSTEM SET shared_buffers = '256MB';
|
||||
ALTER SYSTEM SET effective_cache_size = '1GB';
|
||||
ALTER SYSTEM SET maintenance_work_mem = '64MB';
|
||||
ALTER SYSTEM SET checkpoint_completion_target = 0.9;
|
||||
ALTER SYSTEM SET wal_buffers = '16MB';
|
||||
ALTER SYSTEM SET default_statistics_target = 100;
|
||||
ALTER SYSTEM SET random_page_cost = 1.1;
|
||||
ALTER SYSTEM SET effective_io_concurrency = 200;
|
||||
|
||||
-- Reload configuration
|
||||
SELECT pg_reload_conf();
|
||||
Reference in New Issue
Block a user