doles
doles

Reputation: 556

whats the typical size of data in memory vs data in tuple of a database?

I am working on an application that uses Openstreetmap data in a local server. To enhance speed of searching inside the OSM database, I am considering caching some amount of data in RAM memory (aka the java heap of my application). I want to determine how much RAM will be consumed to cache various amounts of data. The complete data file is around 330 gigs and growing. How much ram would that translate to in memory? In general, is there a way to tell how much RAM would each gig of data in a postgres database consume (if cached outside of the database)?

Thank you folks.

Sachin

Upvotes: 2

Views: 428

Answers (1)

Erwin Brandstetter
Erwin Brandstetter

Reputation: 658252

In-memory representation generally needs more space than on-disk representation. It depends on the involved data types and can be around factor 2.

More info in this thread on pgsql-general by Tom Lane and Ondrej Ivanic.

That's for memory PostgreSQL itself uses. Not sure about the "outside the database" part of the question. You mean disk cache? OS cache? Not sure what the factor would be there.

Upvotes: 1

Related Questions