Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Un9cc-0006S1-IH for pgsql-sql@arkaria.postgresql.org; Thu, 13 Jun 2013 15:39:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Un9cb-00080B-SF for pgsql-sql@arkaria.postgresql.org; Thu, 13 Jun 2013 15:39:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Un9cZ-000803-Vq for pgsql-sql@postgresql.org; Thu, 13 Jun 2013 15:39:32 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Un9cW-0002XP-5R for pgsql-sql@postgresql.org; Thu, 13 Jun 2013 15:39:31 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Un9cU-0004HA-Hq for pgsql-sql@postgresql.org; Thu, 13 Jun 2013 08:39:26 -0700 Date: Thu, 13 Jun 2013 08:39:26 -0700 (PDT) From: rawi To: pgsql-sql@postgresql.org Message-ID: <1371137966540-5759046.post@n5.nabble.com> In-Reply-To: <22495.1371135398@sss.pgh.pa.us> References: <1371123556877-5759021.post@n5.nabble.com> <22495.1371135398@sss.pgh.pa.us> Subject: Re: Index Usage and Running Times by FullTextSearch with prefix matching MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Tom Lane-2 wrote > FWIW, I get fairly decent performance for cases like this in HEAD > (at least with a GIN index; GIST seems much less able to do well with > short prefixes). Short or long prefixes seem to be equaly unfavorable. Even with the full length of the words, but queried as prefix I get a runtime of 25342ms compared to 353ms without prefixes: SELECT count(a) FROM t1 WHERE a_tsvector @@ to_tsquery('aaaaa:* & bbbbb:* & ccccc:* & ddddd:*') Total query runtime: 25342 ms "Aggregate (cost=804.02..804.03 rows=1 width=36)" " -> Bitmap Heap Scan on t1 (cost=800.00..804.02 rows=1 width=36)" " Recheck Cond: (a_tsvector @@ to_tsquery('aaaaa:* & bbbbb:* & ccccc:* & ddddd:*'::text))" " -> Bitmap Index Scan on a_tsvector_idx (cost=0.00..800.00 rows=1 width=0)" " Index Cond: (a_tsvector @@ to_tsquery('aaaaa:* & bbbbb:* & ccccc:* & ddddd:*'::text))" Kind Regards Rawi -- View this message in context: http://postgresql.1045698.n5.nabble.com/Index-Usage-and-Running-Times-by-FullTextSearch-with-prefix-matching-tp5759021p5759046.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql