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 1i7itr-00032F-6r for pgsql-general@arkaria.postgresql.org; Tue, 10 Sep 2019 16:21:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i7itq-0005XO-1k for pgsql-general@arkaria.postgresql.org; Tue, 10 Sep 2019 16:21:50 +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 1i7itp-0005T7-K7 for pgsql-general@lists.postgresql.org; Tue, 10 Sep 2019 16:21:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i7itn-0007JH-9w for pgsql-general@lists.postgresql.org; Tue, 10 Sep 2019 16:21:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x8AGLjDw002534; Tue, 10 Sep 2019 12:21:45 -0400 From: Tom Lane To: Jimmy Huang cc: "pgsql-general@lists.postgresql.org" Subject: Re: pg full text search very slow for Chinese characters In-reply-to: <4C0635DF-420D-42BE-B89B-940882F6A160@live.com> References: <4C0635DF-420D-42BE-B89B-940882F6A160@live.com> Comments: In-reply-to Jimmy Huang message dated "Tue, 10 Sep 2019 15:53:14 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2532.1568132505.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 10 Sep 2019 12:21:45 -0400 Message-ID: <2533.1568132505@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jimmy Huang writes: > I tried pg_trgm and my own customized token parser https://github.com/hu= angjimmy/pg_cjk_parser pg_trgm is going to be fairly useless for indexing text that's mostly multibyte characters, since its unit of indexable data is just 3 bytes (not characters). I don't know of any comparable issue in the core tsvector logic, though. The numbers you're quoting do sound quite awful, but I share Cory's suspicion that it's something about your setup rather than an inherent Postgres issue. regards, tom lane