Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2CC36B5DBF4 for ; Tue, 14 Jun 2011 12:36:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 61058-01-5 for ; Tue, 14 Jun 2011 15:36:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 30DDFB5DC62 for ; Tue, 14 Jun 2011 12:36:23 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 14 Jun 2011 10:36:22 -0500 Message-Id: <4DF7399B020000250003E5AB@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 14 Jun 2011 10:36:11 -0500 From: "Kevin Grittner" To: "Tim" Cc: Subject: Re: tsvector limitations References: <4DF7275C020000250003E59F@gw.wicourts.gov> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/69 X-Sequence-Number: 37695 Tim wrote: > I would be surprised if there is no general "how big is this > object" method in PostgreSQL. You could cast to text and use octet_length(). > If it's "bad design" to store large text documents (pdf,docx,etc) > as a BLOBs or on a filesystem and make them searchable with > tsvectors can you suggest a good design? Well, I suggested that storing a series of novels as a single entry seemed bad design to me. Perhaps one entry per novel or even finer granularity would make more sense in most applications, but there could be exceptions. Likewise, a list of distinct words is of dubious value in most applications' text searches. We extract text from court documents and store a tsvector for each document; we don't aggregate all court documents for a year and create a tsvector for that -- that would not be useful for us. > If making your own search implementation is "better" what is the > point of tsvectors? I remember you asking about doing that, but I don't think anyone else has advocated it. > Maybe I'm missing something here? If you were to ask for real-world numbers you'd probably get farther than demanding that people volunteer their time to perform tests that you define but don't seem willing to run. Or if you describe your use case in more detail, with questions about alternative approaches, you're likely to get useful advice. -Kevin