X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 77A92DBC53 for ; Sat, 19 Nov 2005 13:57:09 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48748-07 for ; Sat, 19 Nov 2005 17:57:08 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id 09D06DBC69 for ; Sat, 19 Nov 2005 13:57:06 -0400 (AST) Received: from moonunit2.moonview.localnet (wsip-68-15-5-150.sd.sd.cox.net [68.15.5.150]) by svr2.postgresql.org (Postfix) with ESMTP id F3BEBF0B09 for ; Sat, 19 Nov 2005 17:57:06 +0000 (GMT) Received: from [192.168.0.3] (moonunit3.moonview.localnet [192.168.0.3]) by moonunit2.moonview.localnet (8.13.1/8.13.1) with ESMTP id jAJI5gOJ002071 for ; Sat, 19 Nov 2005 10:05:42 -0800 Message-ID: <437F66CF.7080402@modgraph-usa.com> Date: Sat, 19 Nov 2005 09:54:23 -0800 From: "Craig A. James" User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Storage/Performance and splitting a table References: <1132136225.5711.4.camel@Panoramix> <437B9DA9.2030806@modgraph-usa.com> <20051117002344.GA55377@winnie.fuhr.org> <437CF055.6020602@modgraph-usa.com> <20051117232857.GA49910@winnie.fuhr.org> <437D3085.9040207@modgraph-usa.com> <20051118034631.GA70159@winnie.fuhr.org> In-Reply-To: <20051118034631.GA70159@winnie.fuhr.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.047 required=5 tests=[AWL=0.047] X-Spam-Score: 0.047 X-Spam-Level: X-Archive-Number: 200511/401 X-Sequence-Number: 15658 In a recent thread, several people pointed out that UPDATE = DELETE+INSERT. This got me to wondering. I have a table that, roughly, looks like this: create table doc ( id integer primary key, document text, keywords tsvector ); where "keywords" has a GIST index. There are about 10 million rows in the table, and an average of 20 keywords per document. I have two questions. First, I occasionally rebuild the keywords, after which the VACUUM FULL ANALYZE takes a LONG time - like 24 hours. Given the UPDATE = DELETE+INSERT, it sounds like I'd be better off with something like this: create table doc ( id integer primary key, document text, ); create table keywords ( id integer primary key, keywords tsvector ); Then I could just drop the GIST index, truncate the keywords table, rebuild the keywords, and reindex. My suspicion is that VACUUM FULL ANALYZE would be quick -- there would be no garbage to collect, so all it would to do is the ANALYZE part. My second question: With the doc and keywords split into two tables, would the tsearch2/GIST performance be faster? The second schema's "keywords" table has just pure keywords (no documents); does that translate to fewer blocks being read during a tsearch2/GIST query? Or are the "document" and "keywords" columns of the first schema already stored separately on disk so that the size of the "document" data doesn't affect the "keywords" search performance? Thanks, Craig