MySQL: What is a page?

后端 未结 3 881
花落未央
花落未央 2021-01-30 05:28

I can\'t for the life of me remember what a page is, in the context of a MySQL database. When I see something like 8KB/page, does that mean 8KB per row or ...?

3条回答
  •  不思量自难忘°
    2021-01-30 06:09

    Well,

    its not really a question about MySql its more about what page size is in general in memory management.

    You can read about that here: http://en.wikipedia.org/wiki/Page_(computer_memory)

    Simply put its the smallest unit of data that is exchanged/stored.

    The default page size is 4k which is probably fine.

    If you have large data-sets or only very few write operations it may improve performance to raise the page size.

    Have a look here: http://db.apache.org/derby/manuals/tuning/perf24.html

    Why? Because more data can be fetched/addressed at once. If the probability is high that the desired data is in close proximity to the data you just fetched, or directly afterwards (well its not really in 3d space but i think you get what i mean), you can just fetch it along in one operation and take better advantage of several caching and data fetching technologies, in general from your hard drive.

    But on the other side you waste space if you have data that doesn't fill up the page size or is just a little bit more or something.

    I personally never had a case where tuning the page size was important. There were always better approaches to optimize performance, and if not, it was already more than fast enough.

提交回复
热议问题