阅读PNUTS论文的时候看到一个词汇:limits on ad hoc queries
什么是ad hoc queries呢?
Ad hoc querying is a term in information science .
Many application software systems have an underlying database which can be accessed by only a limited number of queries and reports. Typically these are available via some sort of menu, and will have been carefully designed, pre-programmed and optimized for performance by expert programmers.
By contrast, "ad hoc" reporting systems allow the users themselves to create specific, customized queries. Typically this would be via a user-friendly GUI -based system without the need for the in-depth knowledge of SQL , or database schema that a programmer would have.
Because such reporting has the potential to severely degrade the performance of a live system, it is usually provided over a data warehouse .
Ad hoc querying/reporting is a business intelligence subtopic, along with OLAP (online analytical processing ), data warehousing, data mining and other tools.
source: http://en.wikipedia.org/wiki/Ad_hoc#Ad_hoc_querying
对于习惯了mysql的人,ad hoc query的概念还真不太好理解,因为它太普通了!打开mysql终端,随便建立一个数据库,随便输入一个查询语句,这些都体现了ad hoc query的概念。那么,什么情况下我们对数据库的管理查询等操作不是ad hoc的呢?回忆一下高中的计算机课本上,将foxPro中创建查询的情形,某种程度上讲,那种只支持固定查询模式的查询,都是非ad hoc的。(注:foxPro的例子可能还不太恰当,因为它实际上还是支持sql语句任意创建查询表的)
在互联网IDC中,为了优化性能,非ad hoc式的query更加常见。数据库操作通常以硬编码的形式融入到了程序中,而数据库内的数据格式通常也会符合某种非通用性的约定。显然,对于这种数据库,sql语句是无能为力的,它们甚至连sql语句解释器都没有呢!