A B-tree index keeps a copy of chosen columns of a table in a balanced sorted tree with pointers to the rows, so that rows with given values or in a range are found in logarithmic time instead of by reading the table. A query plan is the sequence of operations the database chooses to answer a query — which tables it scans, which indexes it searches, how it joins and groups — and can be displayed before the query runs.
bench_tradedb.py, measured_queries.csv.