This is a simplified package for the "Index Advisor (EA&B)" project.
Project description
This is the simplified version of the testbed proposed in the Index Advisor (EA&B) paper, which conducts a comprehensive assessment of the heuristic-based and the learning-based index advisors.
This package implements workflow of the index advisor:
- (1) Index Candidate Generation: synthesizes promising index candidates using predefined strategies;
- (2) Index Selection: iterates over the generated index candidates and selects indexes based on the underlying selection mechanisms;
- (3) Index Benefit Estimation: estimates the benefits of utilizing the selected indexes without actually building the indexes.
The following is the demostration code about how to use this package. Please refer to the original repository for more details :)
# 1. Configuration Setup
host = "-- your host --"
port = "-- your port --"
db_name = "-- your database --"
user = "-- your user --"
password = "-- your password --"
connector = PostgresDatabaseConnector(autocommit=True, host=host, port=port,
db_name=db_name, user=user, password=password)
# 2. Data Preparation
schema_load = "/path/your database schema.json"
with open(schema_load, "r") as rf:
schema_list = json.load(rf)
_, columns = get_columns_from_schema(schema_list)
work_load = "/path/testing workload.json"
with open(work_load, "r") as rf:
work_list = json.load(rf)
for work in work_list:
workload = Workload(read_row_query(work, columns,
varying_frequencies=True, seed=666))
# 3. Index Advisor Evaluation
config = {"budget_MB": 500, "max_index_width": 2, "max_indexes": 5, "constraint": "storage"}
index_advisor = ExtendAlgorithm(connector, config)
indexes = index_advisor.calculate_best_indexes(workload, columns=columns)
break
Note that the data of the /path/your database schema.json
file should be organized in the following format:
[
{
"table": "region",
"rows": 5,
"columns": [
{
"name": "r_regionkey",
"type": "integer"
},
...
]
},
...
]
Besides, the data of the /path/testing workload.json
file should be organized in the following format:
[
[ # workload
[ # query
1, # query ID
"select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, ...", # query text
926 # query frequency
],
...
],
...
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file index_eab-0.1.0.tar.gz
.
File metadata
- Download URL: index_eab-0.1.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd6f6f349e322ae002261e81cdf89dcffcfce8102183f8f727cfdc0fad60aa89 |
|
MD5 | 26d4d09a5fc8166fc7f96fc95a0f931e |
|
BLAKE2b-256 | e8ed3792422d10043b82e508451f6ddc1ab89c4ae2682e7ec6149cbcd8d623f8 |
File details
Details for the file index_eab-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: index_eab-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c083b513851f484e8ab98949657ce93ee35051af182527d4bd1235b38958a9f |
|
MD5 | b71325e434cbe2909e5a88739a2a9b87 |
|
BLAKE2b-256 | 778ad042200b87e86962ef16b9462c1f619e0dbe5e85dc24d4a722c04038e608 |