mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
ftbench fixes
This commit is contained in:
parent
f3e174cac5
commit
061cbf8734
3 changed files with 65 additions and 9 deletions
|
|
@ -41,11 +41,7 @@ sub Favg { my $a=shift; $Pavg*$Ravg ? 1/($a/$Pavg+(1-$a)/$Ravg) : 0; }
|
||||||
$Ravg/=$B*$A if $B;
|
$Ravg/=$B*$A if $B;
|
||||||
$Pavg/=$B if $B;
|
$Pavg/=$B if $B;
|
||||||
|
|
||||||
write;
|
printf "%5d %1.12f\n", $qid, Favg(0.5);
|
||||||
format=
|
|
||||||
@##### @#.#######
|
|
||||||
$qid, Favg(0.5)
|
|
||||||
.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
|
||||||
56
myisam/ftbench/README
Normal file
56
myisam/ftbench/README
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
1. should be run from myisam/ftbench/
|
||||||
|
2. myisam/ftdefs.h should NOT be locked (bk get, not bk edit!)
|
||||||
|
3. there should be ./data/ subdir with test collections, files:
|
||||||
|
test1.test
|
||||||
|
test1.relj
|
||||||
|
test2.test
|
||||||
|
test2.relj
|
||||||
|
where test1, test2, etc - are arbitrary test names
|
||||||
|
|
||||||
|
*.test are SQL files of the structure:
|
||||||
|
=====
|
||||||
|
DROP TABLE IF EXISTS ft;
|
||||||
|
CREATE TABLE ft (
|
||||||
|
id int(10) unsigned NOT NULL,
|
||||||
|
text text NOT NULL,
|
||||||
|
FULLTEXT KEY text (text)
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO ft VALUES (1, 'doc1...'),(2, 'doc2...'),...
|
||||||
|
...
|
||||||
|
|
||||||
|
SELECT COUNT(*) FROM ft;
|
||||||
|
SELECT 1, id, MATCH text AGAINST ('query1') FROM ft WHERE MATCH text AGAINST ('query1');
|
||||||
|
SELECT 2, id, MATCH text AGAINST ('query2') FROM ft WHERE MATCH text AGAINST ('query2');
|
||||||
|
...
|
||||||
|
=====
|
||||||
|
|
||||||
|
*.relj files have the structure:
|
||||||
|
1 16 .....blablabla
|
||||||
|
1 09 .....blablabla
|
||||||
|
2 116 .....blablabla
|
||||||
|
...
|
||||||
|
|
||||||
|
that is /^\d+\s+\d+/
|
||||||
|
and are sorted by the first number (not necessarily by the second)
|
||||||
|
|
||||||
|
4. there should be ./t/ subdir with test directories
|
||||||
|
|
||||||
|
./t
|
||||||
|
./t/BEST/
|
||||||
|
./t/testdir1/
|
||||||
|
./t/testdir2/
|
||||||
|
...
|
||||||
|
|
||||||
|
there *must* be ./t/BEST/ subdir or a symlink to one of other dirs in ./t
|
||||||
|
all other names (besides BEST) can be arbitrary
|
||||||
|
|
||||||
|
all test results are compared with BEST results.
|
||||||
|
|
||||||
|
test directories *must* contain ftdefs.h, and *may* contain my.cnf
|
||||||
|
NOTE: all *.out files in test directories will NOT be overwritten!
|
||||||
|
delete them to re-test
|
||||||
|
|
||||||
|
5. run ./ft-test-run.sh
|
||||||
|
6. go make some coffee
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh -x
|
#!/bin/sh
|
||||||
|
|
||||||
if [ ! -x ./ft-test-run.sh ] ; then
|
if [ ! -x ./ft-test-run.sh ] ; then
|
||||||
echo "Usage: ./ft-test-run.sh"
|
echo "Usage: ./ft-test-run.sh"
|
||||||
|
|
@ -46,7 +46,7 @@ for batch in t/BEST t/* ; do
|
||||||
touch $H
|
touch $H
|
||||||
OPTS="--defaults-file=$BASE/$batch/my.cnf --socket=$SOCK --character-sets-dir=$ROOT/sql/share/charsets"
|
OPTS="--defaults-file=$BASE/$batch/my.cnf --socket=$SOCK --character-sets-dir=$ROOT/sql/share/charsets"
|
||||||
stop_myslqd
|
stop_myslqd
|
||||||
rm $MYSQLD
|
rm -f $MYSQLD
|
||||||
(cd $ROOT; gmake)
|
(cd $ROOT; gmake)
|
||||||
|
|
||||||
for prog in $MYSQLD $MYSQL $MYSQLADMIN ; do
|
for prog in $MYSQLD $MYSQL $MYSQLADMIN ; do
|
||||||
|
|
@ -65,17 +65,21 @@ for batch in t/BEST t/* ; do
|
||||||
--skip-grant-tables --skip-innodb \
|
--skip-grant-tables --skip-innodb \
|
||||||
--skip-networking --tmpdir=$DATA &
|
--skip-networking --tmpdir=$DATA &
|
||||||
|
|
||||||
$MYSQLADMIN $OPTS --connect_timeout=60 ping
|
sleep 60
|
||||||
|
$MYSQLADMIN $OPTS ping
|
||||||
if [ $? != 0 ] ; then
|
if [ $? != 0 ] ; then
|
||||||
echo "$MYSQLD refused to start"
|
echo "$MYSQLD refused to start"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
for test in `cd data; echo *.test|sed "s/\.test\>//g"` ; do
|
for test in `cd data; echo *.test|sed "s/\.test//g"` ; do
|
||||||
|
echo "test $batch/$test"
|
||||||
$MYSQL $OPTS --skip-column-names test <data/$test.test >var/$test.eval
|
$MYSQL $OPTS --skip-column-names test <data/$test.test >var/$test.eval
|
||||||
|
echo "report $batch/$test"
|
||||||
./Ereport.pl var/$test.eval data/$test.relj > $batch/$test.out || exit
|
./Ereport.pl var/$test.eval data/$test.relj > $batch/$test.out || exit
|
||||||
done
|
done
|
||||||
stop_myslqd
|
stop_myslqd
|
||||||
rm -f $H
|
rm -f $H
|
||||||
|
echo "compare $batch"
|
||||||
[ $batch -ef t/BEST ] || ./Ecompare.pl t/BEST $batch >> t/BEST/report.txt
|
[ $batch -ef t/BEST ] || ./Ecompare.pl t/BEST $batch >> t/BEST/report.txt
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue