-
Notifications
You must be signed in to change notification settings - Fork 759
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(query): increase state_rows in copy agg state rows (#17252)
* fix(query): increase state_rows in copy agg state rows * fix(query): increase state_rows in copy agg state rows * fix(query): increase state_rows in copy agg state rows
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 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
6 changes: 6 additions & 0 deletions
6
tests/suites/0_stateless/20+_others/20_0022_agg_memory.result
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,6 @@ | ||
executing 1 | ||
executing 2 | ||
executing 3 | ||
executing 4 | ||
executing 5 | ||
Memory usage difference is less than 5% |
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,46 @@ | ||
#!/usr/bin/env bash | ||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
. "$CURDIR"/../../../shell_env.sh | ||
|
||
|
||
## warmup | ||
for i in `seq 1 2`;do | ||
$BENDSQL_CLIENT_CONNECT --query=""" | ||
select number::string , max(number::string), min(number::string), count(distinct number) from numbers(10000000) group by 1 ignore_result; | ||
""" | ||
done | ||
|
||
|
||
PIDS=($(pgrep databend-query)) | ||
BEFORE_MEM=0 | ||
for PID in "${PIDS[@]}"; do | ||
MEM=$(ps -o rss= -p $PID | tail -n 1) | ||
BEFORE_MEM=$((BEFORE_MEM + MEM)) | ||
done | ||
|
||
|
||
for i in `seq 1 5`;do | ||
echo "executing $i" | ||
$BENDSQL_CLIENT_CONNECT --query=""" | ||
select number::string , max(number::string), min(number::string), count(distinct number) from numbers(10000000) group by 1 ignore_result; | ||
""" | ||
done | ||
|
||
sleep 15 | ||
|
||
|
||
AFTER_MEM=0 | ||
for PID in "${PIDS[@]}"; do | ||
MEM=$(ps -o rss= -p $PID | tail -n 1) | ||
AFTER_MEM=$((AFTER_MEM + MEM)) | ||
done | ||
|
||
# Calculate the difference in percentage | ||
DIFF=$(awk -v before=$BEFORE_MEM -v after=$AFTER_MEM 'BEGIN {print (after-before)/before * 100}') | ||
|
||
# Check if the difference is less than 5% | ||
if (( $(awk -v diff=$DIFF 'BEGIN {print (diff < 5)}') )); then | ||
echo "Memory usage difference is less than 5%" | ||
else | ||
echo "Memory usage difference is greater than 5%, before ${BEFORE_MEM} ${AFTER_MEM}" | ||
fi |