Home > database >  Postgresql memory
Postgresql memory

Time:10-09

In postgres database (installed on Ubuntu), there are some table, the table is not very big, but it is not small, about 50000 records, often need to retrieve:
1. Can be set up in memory?
2. To establish a method of, can you give examples?
Ever can view the table data is saved to the memory of the statement?
What table or view memory preserved the statement?

CodePudding user response:

Cannot be built into the memory, 5 w record and is not much, why is built into the memory

CodePudding user response:

When the data volume more, how to add data to memory,

CodePudding user response:

Article 5 w is not very big, every direct, indexed, if your query is more complex, use stored procedures will be a lot faster, you want to permanent memory, there is no right, seemingly PG in other languages, it can be read into memory

CodePudding user response:

Pg_prewarm extension module can have a look at the,
I just read, no actual use,

CodePudding user response:

Pg is not support memory table, can try vops module, but this approach may need to adjust the table structure

CodePudding user response:

If the data is hot enough to live,
1. Take on the shared_buffer PG naturally.
2. In fact PG is still very dependent on page in memory mechanism of the OS itself, if really hot data, if not to the PG in shared_buffer, OS will make his permanent memory,
3. If the above two mechanisms can avoid frequent in this table swapped out, prove that the table is not enough hot or you should enlarge memory.

CodePudding user response:

If it is a very care about query performance, and the need to modify the static table, suggest a one-time read into memory, use
STD: : vector<> Store
STD: : map<> , STD: : unorderd_map & lt;> , management index,
Performance NNMNN times higher than that of the database, but it will not be able to make connections with other tables,

  • Related