Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvtnU-0005iU-Vt for pgsql-performance@arkaria.postgresql.org; Wed, 05 Apr 2017 22:53:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cvtnU-0001P2-IJ for pgsql-performance@arkaria.postgresql.org; Wed, 05 Apr 2017 22:53:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cvtli-0004tl-M0 for pgsql-performance@postgresql.org; Wed, 05 Apr 2017 22:51:14 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvtlf-000758-KN for pgsql-performance@postgresql.org; Wed, 05 Apr 2017 22:51:13 +0000 Received: from mben.nabble.com (unknown [162.253.133.72]) by mwork.nabble.com (Postfix) with ESMTP id 1852C37B74251 for ; Wed, 5 Apr 2017 15:51:11 -0700 (MST) Date: Wed, 5 Apr 2017 15:51:11 -0700 (MST) From: rverghese To: pgsql-performance@postgresql.org Message-ID: <1491432671098-5954485.post@n3.nabble.com> Subject: Table not using tsvector gin index and performance much worse than when it uses it. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.3 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hi, I have a table with 22k rows - not large at all. I have a couple of indices on it as well as a gin index on a tsvector column. If I reindex the table and run a query it takes ~20ms to execute using the tsvector-gin index. By the end of the day, the planner decides not to use the gin index and uses the other indices on the table and the query takes ~80ms. If I reindex, the pattern repeats-it uses the gin index for a while for superior performance and then drops back to using the alternate ones. The ibloat on the index shows as 0.4 and wastedibytes is 0. Less than 2K rows have been updated of the 22K since the last reindex but the performance has dropped since it is no longer using the gin index by mid-day. Any thoughts on why it chooses to use alternate indices with hardly any updates? And is there a way to force it to use the gin index without having to reindex it twice a day. Thanks! -- View this message in context: http://www.postgresql-archive.org/Table-not-using-tsvector-gin-index-and-performance-much-worse-than-when-it-uses-it-tp5954485.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance