forked from georgia-tech-db/evadb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Cost Estimation for Query - Added support for dynamic creation …
…of histogram tables and refresh of table_stats table for every query
- Loading branch information
Lohith K S
authored and
Lohith K S
committed
Nov 22, 2023
1 parent
5ad867a
commit f9325e3
Showing
4 changed files
with
59 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from evadb.server.command_handler import execute_query_fetch_all | ||
from evadb.configuration import constants | ||
|
||
|
||
class CostEstimatorUtils(): | ||
|
||
def fetch_table_stats(db, query): | ||
query_result = execute_query_fetch_all( | ||
db, query, do_not_print_exceptions=False, do_not_raise_exceptions=True | ||
) | ||
for _, row in query_result.iterrows(): | ||
entry = { | ||
'table_name': row['table_stats.table_name'], | ||
'num_rows': row['table_stats.num_rows'], | ||
'hist': row['table_stats.hist'] | ||
} | ||
constants.EVADB_STATS[row['table_stats.table_name']] = entry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters