Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQywM-0000VE-35 for pgsql-general@arkaria.postgresql.org; Tue, 21 Apr 2020 19:52:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQyq4-00015r-8Y for pgsql-general@arkaria.postgresql.org; Tue, 21 Apr 2020 19:45:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQyq4-000142-0j for pgsql-general@lists.postgresql.org; Tue, 21 Apr 2020 19:45:48 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jQyq1-0005iA-Lg for pgsql-general@lists.postgresql.org; Tue, 21 Apr 2020 19:45:47 +0000 Received: by mail-wm1-x344.google.com with SMTP id u16so4873155wmc.5 for ; Tue, 21 Apr 2020 12:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=Zyv2YWVei1yXffj2sucW4Hhn4ifRuOav+ZNyBic9J9Y=; b=T7lG4ctS5CkE/3KAgEzK+proz5eC6KCCnRXFKcQKwB7YgcLmhCmINANgW0t6niA+EO QlDIn9G6YJu8XUVOc6/xW4GX+X3OXCQJtK/ChomUocX61+eAlu18Kv93giusKWyQSFfG xDLhPEaUDZSyIBAUJAJRWmuBHhJvtZQdwWehHgcGf79Y/M+3syesubuY1ryM9U025Aj4 Pk1vykLjEnm2+aWw+GyvULr91qkZy3PojaPHAx2pXvc/1OHXaxAGgY9dVcwogRCVfRYy 3roi7gUSoExN22kqtqRjTYGkXUv+FMwE3BsDVy2aQ6mpkZpQPSbE0xfEjLJsVsrf9xLQ CA1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Zyv2YWVei1yXffj2sucW4Hhn4ifRuOav+ZNyBic9J9Y=; b=SyTJLUhS6PgpEIKgRZIYp5QVuOxEneLV9oqOjWWg6TyhdG5g0+jgYNwaY0LmsB+0Tj zp/NnLpTJLXvDdzahxLZbwRLbjHXYmxgJAnsNkdPE6wDK5PoWLTr1pjSgAJup4XkCXxo RjACArL4T9b7sGb/pVod9/Kv7/bdSojSTa1B8ge9IAu+fNEuXciGcE7soCU5H65b/49y qY4gJlpLtTfook9HPsAtPkuC1Olh8fMd1f4dFSXMgm4s++Ojl532YXiyq2/TrMLPEUfG RmoArTCaiKkocnOB6eUd1ULmQvYtC+OkMeqnPm9640QWrGsfq0zvbSI1tejbuOf0p6lK aw0w== X-Gm-Message-State: AGi0PuZ++8JiL+s8v0vEoQ2P8grfwDRPzeH4FXATo8wGYPJ/Gss91qCW q12oYO9+3SQri6ZDFklZpoeiNA== X-Google-Smtp-Source: APiQypJt6ZVG4fgUU969AbYKpHdNRKCW1Pjw+m0zODCwR3zRVM0ufxh0pC7G6KveQRLh9jAHeBV7Yw== X-Received: by 2002:a1c:4ca:: with SMTP id 193mr6620469wme.18.1587498343712; Tue, 21 Apr 2020 12:45:43 -0700 (PDT) Received: from dynamic-enq1j2om7y8y91ixf-pd01.res.v6.highway.a1.net (dynamic-enq1j2om7y8y91ixf-pd01.res.v6.highway.a1.net. [2001:871:60:80f6:1713:58c3:d3cd:8713]) by smtp.gmail.com with ESMTPSA id k6sm5112742wma.19.2020.04.21.12.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 12:45:43 -0700 (PDT) Message-ID: Subject: Re: Triggers and Full Text Search * From: Laurenz Albe To: Malik Rumi , pgsql-general@lists.postgresql.org Date: Tue, 21 Apr 2020 21:45:42 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2020-04-21 at 12:24 -0500, Malik Rumi wrote: > More than a year ago, I implemented full text search on one of my sites. > From the beginning, there was one problem (or at least, what I perceive > to be a problem): when I use a script to insert many documents at once, > they do *not* get indexed in fts. If a document is created or inserted > one at a time, fts indexes immediately. The workaround I came up with > was just to open each of those script inserted documents and then close > them. As soon as they are opened, they get indexed. A trigger will fire and update the index immediately. That opening and closing you are talking about does not sound like a database activity. Rather, it sounds like your software is delaying the actual insert into the database, which would of course explain why you cannot find it in the index. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com