]> git.evergreen-ils.org Git - working/Evergreen.git/commit
Optimize full text search with a CTE
authorDan Scott <dscott@laurentian.ca>
Wed, 16 May 2012 04:29:11 +0000 (00:29 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 17 May 2012 15:26:31 +0000 (11:26 -0400)
commitf2a11f55a53d3f5a5af1510a4d1016711e0763da
treecd1230154ebd54bbf10eb5581ebf87f7e68af7ce
parent3a02ddaec1e6c7536c8771ea611e32df95816736
Optimize full text search with a CTE

The tsquery used directly in a JOIN was resulting in bad
plan with lots of nested loops and operations. Using a CTE
to define the query improves the plan.

Also, instead of ARRAY_AGG(DISTINCT foo), just return the
whole thing in an array. Not great for dupes, but we can
handle those inside search.query_parser_fts if we really
need to.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm