-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: usamoi <usamoi@outlook.com>
- Loading branch information
Showing
5 changed files
with
79 additions
and
9 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
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,27 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
d=$(psql -U postgres -tAqX -c "SELECT CURRENT_SETTING('data_directory')")/pg_vectors/indexes | ||
|
||
a=$(sudo ls -1 $d | wc -l) | ||
|
||
printf "entries = $a\n" | ||
|
||
psql -f $(dirname $0)/test.sql & | ||
sleep 10s | ||
|
||
sudo killall -9 postgres | ||
sleep 1s | ||
|
||
sudo systemctl restart postgresql | ||
|
||
b=$(sudo ls -1 $d | wc -l) | ||
|
||
printf "entries = $b\n" | ||
|
||
if [ "$a" == "$b" ]; then | ||
echo "Unlogged test [OK]" | ||
else | ||
echo "Unlogged test [FAILED]" | ||
exit 1 | ||
fi |
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,7 @@ | ||
CREATE UNLOGGED TABLE tests_unlogged_t(val vector(3)); | ||
|
||
INSERT INTO tests_unlogged_t (val) SELECT ARRAY[random(), random(), random()]::real[] FROM generate_series(1, 1000); | ||
|
||
CREATE INDEX ON tests_unlogged_t USING vectors (val vector_l2_ops); | ||
|
||
SELECT pg_sleep(60); -- 60 seconds |