System load based adaptive prefetch
First Claim
1. A method implemented in a computer, the method comprising:
- determining usage of a buffer cache;
prefetching into the buffer cache, blocks of data equal in number to a prefetch size; and
changing said prefetch size depending at least partially on a fraction of said prefetched blocks that are wasted without use.
1 Assignment
0 Petitions
Accused Products
Abstract
A number, of the blocks of data to be prefetched into a buffer cache, is determined dynamically at run time (e.g. during execution of a query), based at least in part on the load placed on the buffer cache. An application program (such as a database) is responsive to the number (also called “prefetch size”), to determine the amount of prefetching. A sequence of instructions (also called “prefetch size daemon”) computes the prefetch size based on, for example, the number of prefetched blocks aged out before use. The prefetch size daemon dynamically revises the prefetch size based on usage of the buffer cache, thereby to form a feedback loop. Depending on the embodiment, at times of excessive use of the buffer cache, prefetching may even be turned off. Although in one embodiment described herein the prefetch size daemon is implemented in a database, in other embodiments other kinds of applications and/or the operating system itself can use a prefetch size daemon of the type described herein to dynamically determine and change prefetch behavior.
48 Citations
27 Claims
-
1. A method implemented in a computer, the method comprising:
-
determining usage of a buffer cache; prefetching into the buffer cache, blocks of data equal in number to a prefetch size; and changing said prefetch size depending at least partially on a fraction of said prefetched blocks that are wasted without use. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A method implemented in a computer that supports a plurality of clients, the method comprising:
-
determining usage of a buffer cache; prefetching into the buffer cache, blocks of data equal in number to a prefetch size; and changing said prefetch size at least partially dependent inversely on a number of clients; wherein said computer currently prefetches data blocks into the buffer cache in response to said clients. - View Dependent Claims (7, 8, 9)
-
-
10. A method implemented in a computer, said computer comprising a database, the method comprising:
-
determining usage of a buffer cache; and prefetching into the buffer cache, blocks of data whose number depends at least in part on usage of the buffer cache; wherein the prefetching is performed at least when a clustering factor is high, with a low clustering factor indicating that individual rows being fetched are concentrated within fewer blocks in a table of said database, and a high clustering factor indicating that individual rows are scattered rather than being collocated. - View Dependent Claims (11, 12)
-
-
13. A method implemented in a computer that supports a plurality of clients, the method comprising:
-
prefetching into a buffer cache, at least one block of data in response to at least one request from one client; determining a fraction of a set of blocks in said buffer cache that have been prefetched and later aged out before use; and prefetching an additional number of blocks into said buffer cache, said additional number depending at least in part on said fraction. - View Dependent Claims (14, 15, 16, 17, 18, 19)
-
-
20. A computer-readable storage medium encoded with a plurality of instructions, said plurality of instructions comprising:
-
instructions to determine usage of a buffer cache; instructions to prefetch into the buffer cache, a number of blocks of data; wherein said number depends on a prefetch size; and instructions to change said prefetch size depending at least partially on a fraction of said blocks that are prefetched, by said instructions to prefetch, and are wasted without use.
-
-
21. A computer-readable storage medium encoded with a plurality of instructions, said plurality of instructions comprising:
-
instructions to determine usage of a buffer cache of a computer; instructions to prefetch into the buffer cache, a number of blocks of data; wherein said number depends on a prefetch size; and instructions to change said prefetch size at leats partially dependent inversely on a number of clients, which clients receive data from the computer based on said prefetching.
-
-
22. A computer-readable storage medium encoded with a plurality of instructions to be executed by a computer, said plurality of instructions comprising:
-
instructions to determine usage of a buffer cache; and instructions to prefetch into the buffer cache, blocks of data whose number depends at least in part on usage of the buffer cache; wherein the instructions to prefetch are executed at least when a clustering factor is high, with a low clustering factor indicating that individual rows being fetched are concentrated within fewer blocks in a table of a database in said computer, and a high clustering factor indicating that individual rows are scattered rather than being collocated.
-
-
23. A computer comprising:
-
a storage medium containing data; means, coupled to the storage medium, for determining usage of a buffer cache for data in the storage medium; and means, coupled to the determining means and coupled to the storage medium, for prefetching from the storage medium into the buffer cache, blocks of data equal in number to a prefetch size; wherein the means for determining includes a storage location indicative of a fraction of said prefetched blocks that are wasted without use. - View Dependent Claims (24)
-
-
25. A computer comprising:
-
a storage medium containing data; means, coupled to the storage medium, for determining usage of a buffer cache for data in the storage medium; and means, coupled to the determining means and coupled to the storage medium, for prefetching from the storage medium into the buffer cache, blocks of data whose number depends at least in part on usage of the buffer cache; wherein the means for determining includes a storage location encoded with a number of clients that currently prefetch data blocks into the buffer cache.
-
-
26. A computer comprising:
-
a storage medium containing data of a database; means, coupled to the storage medium, for determining usage of a buffer cache for data in the storage medium; and means, coupled to the determining means and coupled to the storage medium, for prefetching from the storage medium into the buffer cache, blocks of data whose number depends at least in part on usage of the buffer cache; wherein the means for prefetching performs prefetching at least when a clustering factor is high, with a low clustering factor indicating that individual rows being fetched are concentrated within fewer blocks in a table of said database, and a high clustering factor indicating that individual rows are scattered rather than being collocated.
-
-
27. A computer-readable storage medium encoded with a plurality of instructions, said plurality of instructions comprising:
-
instructions to prefetch into a buffer cache, at least one block of data in response to at least one request from one client; instructions to determine a count of blocks in said buffer cache that have been prefetched and later aged out before use; and instructions to prefetch an additional number of blocks into said buffer cache, said additional number depending at least in part on said count.
-
Specification