Accurate prediction of operator execution time is a prerequisite for database query optimization. Although extensively studied for conventional disk-based DBMSs, cost modeling in mainmemory DBMSs is still an open issue. Recent database research has demonstrated that memory access is more and more becoming a significantif not the major-cost component of database operations. If used properly, fast but small cache memories-usually organized in cascading hierarchy between CPU and main memory-can help to reduce memory access costs. However, they make the cost estimation problem more complex. In this article, we propose a generic technique to create accurate cost functions for database operations. We identify a few basic memory access patterns and provide cost functions that estimate their access costs for each level of the memory hierarchy. The cost functions are parameterized to accommodate various hardware characteristics appropriately. Combining the basic patterns, we can describe the memory access patterns of database operations. The cost functions of database operations can automatically be derived by combining the basic patterns' cost functions accordingly. To validate our approach, we performed experiments using our DBMS prototype Monet. The results presented here confirm the accuracy of our cost models for different operations. Aside from being useful for query optimization, our models provide insight to tune algorithms not only in a main-memory DBMS, but also in a diskbased DBMS with a large main-memory buffer cache.
A generic cost model for various database workloads was proposed by Manegold et al. REF .
Generic Database Cost Models for Hierarchical Memory Systems
VLDB
Computer Science