Skip to content

Commit

Permalink
fix: found which queries work for JOB with automated script (#166)
Browse files Browse the repository at this point in the history
**Summary**: figured out the definitive list of 98 / 113 queries which
are currently working in optd.

**Details**:
* "Work" is with DataFusion's logical optimizer, not optd's.
* Also wrote an automated script, `which_queries_work.sh`, which can
automatically update this list as we get more queries to work.
* `which_queries_work.sh` also works with TPC-H as well
  • Loading branch information
wangpatrick57 authored Apr 24, 2024
1 parent 7574267 commit 8354c78
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
43 changes: 43 additions & 0 deletions dev_scripts/which_queries_work.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
benchmark_name=$1
USAGE="Usage: $0 [job|tpch]"

if [ $# -ne 1 ]; then
echo >&2 $USAGE
exit 1
fi

if [[ "$benchmark_name" == "job" ]]; then
all_ids="1a,1b,1c,1d,2a,2b,2c,2d,3a,3b,3c,4a,4b,4c,5a,5b,5c,6a,6b,6c,6d,6e,6f,7a,7b,7c,8a,8b,8c,8d,9a,9b,9c,9d,10a,10b,10c,11a,11b,11c,11d,12a,12b,12c,13a,13b,13c,13d,14a,14b,14c,15a,15b,15c,15d,16a,16b,16c,16d,17a,17b,17c,17d,17e,17f,18a,18b,18c,19a,19b,19c,19d,20a,20b,20c,21a,21b,21c,22a,22b,22c,22d,23a,23b,23c,24a,24b,25a,25b,25c,26a,26b,26c,27a,27b,27c,28a,28b,28c,29a,29b,29c,30a,30b,30c,31a,31b,31c,32a,32b,33a,33b,33c"
elif [[ "$benchmark_name" == "tpch" ]]; then
all_ids="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22"
else
echo >&2 $USAGE
exit 1
fi

successful_ids=()
IFS=','
for id in $all_ids; do
cargo run --bin optd-perftest cardtest --benchmark-name $benchmark_name --query-ids $id &>/dev/null

if [ $? -eq 0 ]; then
echo >&2 $id succeeded
successful_ids+=("$id")
else
echo >&2 $id failed
fi
done

echo >&2
echo " Useful Outputs"
echo "================"
working_query_ids_vec="pub const WORKING_QUERY_IDS: &[&str] = &[\"${successful_ids[0]}\""
IFS=" "
for id in "${successful_ids[@]:1}"; do
working_query_ids_vec+=", \"$id\""
done
working_query_ids_vec+="]"
echo "${working_query_ids_vec}"
IFS=","
echo "--query-ids ${successful_ids[*]}"
9 changes: 7 additions & 2 deletions optd-perftest/src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ const JOB_KIT_REPO_URL: &str = "https://github.com/wangpatrick57/job-kit.git";
const JOB_TABLES_URL: &str = "https://homepages.cwi.nl/~boncz/job/imdb.tgz";
pub const WORKING_QUERY_IDS: &[&str] = &[
"1a", "1b", "1c", "1d", "2a", "2b", "2c", "2d", "3a", "3b", "3c", "4a", "4b", "4c", "5a", "5b",
"5c", "6a", "6b", "6c", "6d", "8a", "8b", "8c", "8d", "10a", "10b", "10c", "12a", "12b", "12c",
"13a", "14a",
"5c", "6a", "6b", "6c", "6d", "6e", "6f", "7b", "8a", "8b", "8c", "8d", "9b", "9c", "9d",
"10a", "10b", "10c", "12a", "12b", "12c", "13a", "13b", "13c", "13d", "14a", "14b", "14c",
"15a", "15b", "15c", "15d", "16a", "16b", "16c", "16d", "17a", "17b", "17c", "17d", "17e",
"17f", "18a", "18c", "19b", "19c", "19d", "20a", "20b", "20c", "22a", "22b", "22c", "22d",
"23a", "23b", "23c", "24a", "24b", "25a", "25b", "25c", "26a", "26b", "26c", "28a", "28b",
"28c", "29a", "29b", "29c", "30a", "30b", "30c", "31a", "31b", "31c", "32a", "32b", "33a",
"33b", "33c",
];

#[derive(Clone, Debug, Serialize, Deserialize)]
Expand Down

0 comments on commit 8354c78

Please sign in to comment.