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
],
...
],
...
]
Release files for index-eab 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| index_eab-0.1.0.tar.gz | 16.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| index_eab-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.1 kB
Release files / index_eab-0.1.0.tar.gz
| Download URL | index_eab-0.1.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd6f6f349e322ae002261e81cdf89dcffcfce8102183f8f727cfdc0fad60aa89
|
|
BLAKE2b-256 checksum How to use checksums |
e8ed3792422d10043b82e508451f6ddc1ab89c4ae2682e7ec6149cbcd8d623f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.7
|
Release files / index_eab-0.1.0-py3-none-any.whl
| Download URL | index_eab-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c083b513851f484e8ab98949657ce93ee35051af182527d4bd1235b38958a9f
|
|
BLAKE2b-256 checksum How to use checksums |
778ad042200b87e86962ef16b9462c1f619e0dbe5e85dc24d4a722c04038e608
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.7
|