The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update pgrepack.mdx
dannykngc96bf72594bd
diff --git a/apps/docs/pages/guides/database/extensions/pgrepack.mdx b/apps/docs/pages/guides/database/extensions/pgrepack.mdxindex f5e72d718d2..bea7f7474b2 100644--- a/apps/docs/pages/guides/database/extensions/pgrepack.mdx+++ b/apps/docs/pages/guides/database/extensions/pgrepack.mdx@@ -1,34 +1,31 @@import Layout from '~/layouts/DefaultGuideLayout'export const meta = {- id: 'pg_repack',title: 'pg_repack: Physical storage optimization and maintenance',description:'A tool to remove bloat from tables and indexes and optimize physical data order and physical storage',}-[pg_repack](https://github.com/reorg/pg_repack) is a PostgreSQL extension which lets you remove bloat from tables and indexes, and optionally restore the physical order of clustered indexes. Unlike CLUSTER and VACUUM FULL it works online, without holding an exclusive lock on the processed tables during processing. pg_repack is efficient to boot, with performance comparable to using CLUSTER directly.--## Overview+[pg_repack](https://github.com/reorg/pg_repack) is a PostgreSQL extension to remove bloat from tables and indexes, and optionally restore the physical order of clustered indexes. Unlike CLUSTER and VACUUM FULL it works online, without holding an exclusive lock on the processed tables during processing. pg_repack is efficient to boot, with performance comparable to using CLUSTER directly.pg_repack provides the following methods to optimize physical storage:-1. Online CLUSTER: ordering table data by cluster index in a non-blocking way-2. Ordering table data by specified columns-3. Online VACUUM FULL: packing rows only in a non-blocking way-4. Rebuild or relocate only the indexes of a table+- Online CLUSTER: ordering table data by cluster index in a non-blocking way+- Ordering table data by specified columns+- Online VACUUM FULL: packing rows only in a non-blocking way+- Rebuild or relocate only the indexes of a table## Requirements-1. Only superusers can use the utility-2. Target table must have a PRIMARY KEY, or at least a UNIQUE total index on a NOT NULL column.-3. Performing a full-table repack requires free disk space about twice as large as the target table and its indexes.+- Only superusers can use the utility.+- Target table must have a PRIMARY KEY, or a UNIQUE total index on a NOT NULL column.+- Performing a full-table repack requires free disk space about twice as large as the target table and its indexes.## Usage### Enable the extension-You can get started with pg_repack by enabling the extension in your Supabase dashboard.+Get started with pg_repack by enabling the extension in the Supabase Dashboard.<Tabsscrollable@@ -49,7 +46,7 @@ You can get started with pg_repack by enabling the extension in your Supabase da-- Example: enable the "pg_repack" extensioncreate extension pg_repack with schema extensions;--- Example: disable the "postgis" extension+-- Example: disable the "pg_repack" extensiondrop extension if exists pg_repack;```@@ -58,7 +55,7 @@ drop extension if exists pg_repack;### Syntax-```+```shpg_repack [OPTION]... [DBNAME]```@@ -69,40 +66,40 @@ otherwise.Perform an online CLUSTER of all the clustered tables in the database `db`, and perform an online `VACUUM FULL` of all the non-clustered tables:-```+```shpg_repack db```Perform an online `VACUUM FULL` on the tables `table1` and `table2` in the database `db` (an eventual cluster index is ignored):-```+```shpg_repack --no-order --table table1 --table table2 db```-Moving indexes to tablespace on a faster volume increase performance of `SELECT` queries using these indexes+Moving indexes to a tablespace on a faster volume increases performance of `SELECT` queries using these indexesdrastically. `INSERT`s and `UPDATE`s of a table with indexes on a fast volume are also faster. This is very useful-when fast volume is small and can not accomodate all tables, as indexes are much smaller than tables.+when the fast volume is small and can not accommodate all tables, as indexes are much smaller than tables.Move all indexes of table `table1` to tablespace `tbs`:-```+```shpg_repack -d db --table table1 --only-indexes --tablespace tbs```Move the specified index `idx` to tablespace `tbs`:-```+```shpg_repack -d db --index idx --tablespace tbs```-For full list of options please refer: [Official pg_repack documentation](https://reorg.github.io/pg_repack/)+See the [official pg_repack documentation](https://reorg.github.io/pg_repack/) for the full list of options.## Restrictions-1. pg_repack cannot reorganize temp tables-2. pg_repack cannot cluster tables by GiST indexes-3. You can not to perform DDL commands of the target tables except VACUUM or ANALYZE while pg_repack is working.- pg_repack holds an ACCESS SHARE lock on the target table to enforce this restriction.+- pg_repack cannot reorganize temp tables.+- pg_repack cannot cluster tables by GiST indexes.+- You cannot perform DDL commands of the target tables except VACUUM or ANALYZE while pg_repack is working.+ pg_repack holds an ACCESS SHARE lock on the target table to enforce this restriction.## Resources