天天看點

Ad hoc querying

閱讀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語句解釋器都沒有呢!