[OPEN-ILS-DEV] Heating up search

Robin H. Johnson rjohnson at sitka.bclibraries.ca
Tue May 24 14:48:26 EDT 2011


On Tue, May 24, 2011 at 08:34:39AM -0400, Duimovich, George wrote:
> Hello Robin,
> 
> Seems like the attached script didn't come through - possibly scrubbed
> by 'spam' filters ?
> 
> Anyways, could you post a URL link to the script and/or re-send please. 
Inlined here instead. Change the variables as needed.

====
#!/bin/bash
# Force the Evergreen fulltext indexes into FS cache
# robbat2, 2011/04/22
# Based on http://coffeecode.net/archives/165-Heating-up-Evergreen-search.html
SQL="SELECT relfilenode FROM pg_class WHERE relname LIKE '%vector%' OR relname LIKE '%idx';"
BASEDIR=/srv/postgresql/8.4-master/main/
LISTFILE=/tmp/`basename ${0}`.$$.list
PSQL_AUTH='...'
DB='evergreen'
PSQL="psql -At ${PSQL_AUTH} ${evergreen}"
OIDS="$(${PSQL} -c "${SQL}")"
FO=/usr/local/bin/filelist-order
RL=/usr/local/sbin/readahead-list
for f in $OIDS ; do 
	find $BASEDIR \( -name "$f" -o -name "${f}.*" \)
done | $FO >${LISTFILE}
$RL ${LISTFILE}
rc=$?
[[ $rc -eq 0 ]] && rm -f $LISTFILE
exit $?
====

-- 
Robin Hugh Johnson
SITKA: Sysadmin


More information about the Open-ils-dev mailing list