DEFINITIONS
Definitions More Info.
Definition ID
853
Title
POSTGRESQL
Category
NOTES
Definition
rebuild index script with vacuum
Definition Description
-- Birinci adım VACUUM
SELECT
'REINDEX TABLE "' || table_schema || '"."' || table_name || '";' || E'\n' || 'VACUUM(VERBOSE, ANALYZE)"' || table_schema || '"."' || table_name || '";'
FROM
INFORMATION_SCHEMA.TABLES
WHERE
TABLE_SCHEMA = 'pg_catalog'
AND table_type = 'BASE TABLE';
-- İkinci adım REINDEX
Bu sorgunun sonucunda tabloların tum indexlerini rebuild eden sorguyu calistirirsin.
SELECT
'REINDEX TABLE "' || table_schema || '"."' || table_name || '";'
FROM
INFORMATION_SCHEMA.TABLES
WHERE
TABLE_SCHEMA = 'pg_catalog'
AND table_type = 'BASE TABLE';
RecordBy
cunay
Record Date
04-07-2018 16:04:05
Düzenle
Kopyala
Sil