Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNDwp-0003Th-8W for pgsql-general@arkaria.postgresql.org; Thu, 15 Nov 2018 09:28:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNDwm-0005vN-M7 for pgsql-general@arkaria.postgresql.org; Thu, 15 Nov 2018 09:28:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNDwm-0005vF-5a for pgsql-general@lists.postgresql.org; Thu, 15 Nov 2018 09:28:24 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNDwh-0005Ye-KM for pgsql-general@postgresql.org; Thu, 15 Nov 2018 09:28:22 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 1638B21C759D; Thu, 15 Nov 2018 12:28:17 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.237] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id CB65421C7599; Thu, 15 Nov 2018 12:28:16 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1542274096; bh=Q7QFhhUjgCuTiEPk0u5I5g0NgTniyx/QZpD64jjOCF4=; h=Subject:To:References:From:Date:In-Reply-To; b=Rney1HUpIp5jLlkTogtptIRDr/0ZpucUEM11ucRgYzr1G3T7iYgp1jZiBhDB0bd2a 10d91FAOoQKDm7+hBRYIb+RZxiRULO3cPCs/Go9H0rJz/Gs5K3yDAdUpe1DD/Dn5ZY PIcKS9lkOQjAB7m4Vxs/721mR5CK+/3LjT3MRWqs= Subject: Re: <-> Operator on Trigram Index To: Jeffrey Kamei , pgsql-general@postgresql.org References: From: Arthur Zakirov Message-ID: Date: Thu, 15 Nov 2018 12:28:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, On 14.11.2018 01:42, Jeffrey Kamei wrote: > I'm trying to get the <-> operator to recognize a trigram index (GIST) > I've set on a table. Using `EXPLAIN VERBOSE` I can see the query engine > ignoring the trigram index when using the `<->` operator. However if I > use the `%` operator, the index is found and used. Can you explain why > this is happening? As far as I can tell from the documentation, the > `<->` operator should be using the index as well. Yes <-> operator should use a GiST index. Can you show your query and its plan? -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company