Reverse Engineering Top-k Database Queries with PALEO
Kiril Panev, Sebastian Michel · Movebank · 2016
Ranked lists are an essential methodology to succinctly summarize outstanding items, computed over database tables or crowdsourced in dedicated websites. In this work, we address the problem of reverse engineering top-k queries over a database, that is, given a relation R and a sample topk result list, our approach, named PALEO 1 , aims at determining an SQL query that returns the provided input result when executed over R. The core problem consists of nding predicates of the where clause that return the given items, determining the correct ranking criteria, and to evaluate the most promising candidate queries rst. To capture cases where only a sample of R is available or when R is dierent to the relation that indeed generated the input, we put forward a probabilistic model that allows assessing the chance of a query to output tuples that are resembling or are somewhat close to the input data. We further propose an iterative candidate query execution to further eliminate unpromising queries before being executed. We report on the results of a comprehensive performance evaluation using data and queries of the TPC-H and SSB [14] benchmarks.