Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making Postgres SQL minimal size. How?

I want to cut Postgres to its minimal size for purpose of including just database function with my application. I'm using Portable Postgres found on internet. Any suggestions what I can delete from Postgres installation which is not needed for normal database use?

like image 475
xchg.ca Avatar asked Jun 13 '10 06:06

xchg.ca


People also ask

How do I scale in PostgreSQL?

There are two main ways to scale our database… Horizontal Scaling (scale-out): It's performed by adding more database nodes creating or increasing a database cluster. Vertical Scaling (scale-up): It's performed by adding more hardware resources (CPU, Memory, Disk) to an existing database node.

How much RAM is needed for PostgreSQL?

The 2GB of memory is a recommendation for memory you can allocate to PostgreSQL outside of the operating system.

How big is too big for a PostgreSQL table?

PostgreSQL normally stores its table data in chunks of 8KB. The number of these blocks is limited to a 32-bit signed integer (just over two billion), giving a maximum table size of 16TB.


1 Answers

You can delete all the standalone tools in /bin - it can all be done with psql. Keep anything that starts wth pg_, postgres and initdb.

You can probably delete a bunch of conversions in lib/ (the some_and_some.so) files, but probably not until after you've initdb'ed. And be careful not to delete one you'll be using at some point - they are dynamically loaded so you won't notice until a client connects with a different encoding for example.

But note that this probably won't get you much - on my system with debug enabled etc, the binaries take 17Mb. The clean data directory with no data at all in it takes 33Mb, about twice as much. Which you will need if you're going to be able to use your database..

like image 196
Magnus Hagander Avatar answered Sep 28 '22 07:09

Magnus Hagander