How does PG know if data is in memory?

Поиск
Список
Период
Сортировка
От Fabrício dos Anjos Silva
Тема How does PG know if data is in memory?
Дата
Msg-id AANLkTin5G0jXUbeNdC+1s9LQpk1ZpvDuX-6n90oonen3@mail.gmail.com
обсуждение исходный текст
Ответы Re: How does PG know if data is in memory?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: How does PG know if data is in memory?  (Samuel Gendler <sgendler@ideasculptor.com>)
Re: How does PG know if data is in memory?  (Greg Smith <greg@2ndquadrant.com>)
Список pgsql-performance
   Hi,

   After reading lots of documentation, I still don't understand fully how PG knows if some needed data is in memory or in second storage.

   While choosing the best query plan, the optimizer must take this into account. Does PG consider this? If so, how does it know?

   I presume it checks its shared buffer. But if the data is not in the shared buffer, it could be on OS cache, and the plan would not be optimized.

   Can PG check the OS cache? If not, considering a dedicated DB server, is it advised to raise the shared buffer size up to a maximum that does not influence the rest of the system? This way, the shared buffer check would have a higher probability of returning a correct answer.

   When setting seq_page_cost and random_page_cost, do I have to consider the probability that data will be in memory? Or does seq_page_cost mean "sequential access on disk" and random_page_cost mean "random access on disk"?

   I appreciate if someone could clear this out.

   Thanks!

Fabrício dos Anjos Silva
LinkCom Soluções em T.I.

В списке pgsql-performance по дате отправления:

Предыдущее
От: Tobias Brox
Дата:
Сообщение: Re: Memory usage - indexes
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: How does PG know if data is in memory?