Twice-cooked Blog

Learning & Exploration

Original Title: Significantly Reducing Database Query Load Using the Spatial Locality of Reference

Locality of Reference

The locality of reference in programs refers to the tendency of a program to execute a small, localized portion of its code at any given time. Similarly, the memory accessed during execution is limited to a small region of the computer’s memory.

The locality of reference can be divided into:

  • Temporal Locality: Refers to the likelihood that recently accessed data or instructions will be accessed again soon. For example, function parameters or local variables used in a function are likely to be reused shortly.
  • Spatial Locality: Refers to the tendency that once a particular memory location is accessed, nearby memory locations will be accessed soon after. This is common in loops; for example, if the third element in an array is accessed, the fourth element is likely to be accessed in the next iteration.
Read more »

This is my personal blog.

Mainly about technology learning and thinking, but not limited to this.

Insist on originality, Update aperiodically.

Read more »