1. A method of establishing a sampled query of tables in a database, the method comprising: a) receiving a query referencing a fact table and at least one other joined table in the database stored in a computer-readable medium, a sampling specification for the query, and an index on fact table keys of the fact table; b) generating, using the index, a subset of records of the fact table keys after receiving the query, wherein the index includes keys of the at least one other joined table; c) generating, based on the received sampling specification for the query, a sampling predicate to sample the generated subset of the fact table keys; d) sampling, based on the generated sampling predicate, the generated subset to obtain a sampled subset; e) retrieving selected records from the at least one other joined table, which records correspond to records of the sampled subset of the fact table keys; and f) executing, using a processor, the query based on the sampled subset and the selected records from the at least one other joined table.