Skip to content

Conversation

@patdevinwilson
Copy link
Contributor

I’ve reverted the previous stats-checking logic and repurposed the changes so the PR now ensures we automatically run ANALYZE right after tables are created by the setup scripts. This targets your earlier suggestion directly:
setup_benchmark_tables.sh now runs ./analyze_tables.sh --schema-name ... after creating the tables, so column stats are always produced.
setup_benchmark_data_and_tables.sh already calls the tables script, so it inherits the same behavior (no duplicate logic needed).
Both scripts print clear messaging before and after ANALYZE to show progress.

Copy link
Contributor

@mattgara mattgara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just had a suggestion to make this behaviour optional with a sensible default.


./setup_benchmark_tables.sh -b $BENCHMARK_TYPE -s $SCHEMA_NAME -d $DATA_DIR_NAME

echo "Running ANALYZE TABLES for schema '$SCHEMA_NAME'..."
Copy link
Contributor

@mattgara mattgara Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably makes sense to make this optional. Otherwise, for the foreseeable future this would place a CPU worker requirement on this script (due to the requirement on the analyze tables script.)

That is add a command line option to this script that (may be enabled by default) will toggle this behaviour on/off.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, and I'm in favor of having the option "on" by default.

I think we should also add a check when the option is "on" to make sure we are running on CPU workers (as ANALYZE is currently not supported by GPU workers, as Matt alluded to). If the option is set and we are running on GPU, then I think we should abort the script with an error suggesting we run analyze_tables.sh with CPU workers


./setup_benchmark_tables.sh -b $BENCHMARK_TYPE -s $SCHEMA_NAME -d $DATA_DIR_NAME

echo "Running ANALYZE TABLES for schema '$SCHEMA_NAME'..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, and I'm in favor of having the option "on" by default.

I think we should also add a check when the option is "on" to make sure we are running on CPU workers (as ANALYZE is currently not supported by GPU workers, as Matt alluded to). If the option is set and we are running on GPU, then I think we should abort the script with an error suggesting we run analyze_tables.sh with CPU workers

--schemas-dir-path $TEMP_SCHEMA_DIR \
--data-dir-name $DATA_DIR_NAME

echo "Running ANALYZE TABLES for schema '$SCHEMA_NAME'..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this leads to analyze_tables.sh being called twice, does it not? As setup_benchmark_data_and_tables.sh calls setup_benchmark_tables.sh on line 63?

I think we can just have the one copy here.


echo "Running ANALYZE TABLES for schema '$SCHEMA_NAME'..."
./analyze_tables.sh --schema-name "$SCHEMA_NAME"
echo "Column statistics refreshed for schema '$SCHEMA_NAME'."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This message does not match the previous message. Consider something along the lines of "ANALYZE TABLES successfully executed for schema '$SCHEMA_NAME'".

@patdevinwilson
Copy link
Contributor Author

Updated. Both setup scripts now accept --analyze-tables/--skip-analyze (default on), guard against GPU-only clusters before running ANALYZE, and log “ANALYZE TABLES successfully executed…” when it runs. setup_benchmark_data_and_tables.sh passes the flag through and no longer runs ANALYZE twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants