Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C43D2B5DBC8 for ; Wed, 15 Jun 2011 15:31:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 75815-06 for ; Wed, 15 Jun 2011 18:31:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 6BBF0B5D95B for ; Wed, 15 Jun 2011 15:31:29 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p5FIVSPv018956; Wed, 15 Jun 2011 14:31:28 -0400 (EDT) To: "Mark Johnson" cc: "Kevin Grittner" , "Tim" , pgsql-admin@postgresql.org, "Greg Williamson" Subject: Re: tsvector limitations In-reply-to: References: Comments: In-reply-to "Mark Johnson" message dated "Wed, 15 Jun 2011 17:28:41 -0000" Date: Wed, 15 Jun 2011 14:31:28 -0400 Message-ID: <18955.1308162688@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/83 X-Sequence-Number: 37709 "Mark Johnson" writes: > When this discussion first started, I immediately thought about people > who full text index their server's log files. As a test I copied > /var/log/messages to $PGDATA and then used the same pg_read_file() > function you mentioned earlier to pull the data into a column of type > text. The original file was 4.3 MB, and the db column had length > 4334920 and the function pg_column_size reported a size of 1058747. I > then added a column named tsv of type tsvector, and populated it using > to_tsvector(). The function pg_column_size reported 201557. So in this > test a 4.2 MB text file produced a tsvector of size 200 KB. If this > scales linearly, ... which it won't. There is no real-world full text indexing application where there aren't many duplications of words. (The OP eventually admitted that his "test case" was a dictionary word list and not an actual document.) Any discussion of required tsvector sizes that doesn't account for the actual, nonlinear scaling behavior isn't worth the electrons it's printed on. regards, tom lane