Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 0F35D9F979C for ; Tue, 28 Aug 2007 16:04:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 78218-02 for ; Tue, 28 Aug 2007 16:04:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from crestone.coronasolutions.com (crestone.coronasolutions.com [66.45.104.24]) by postgresql.org (Postfix) with ESMTP id B71AF9F9A7C for ; Tue, 28 Aug 2007 16:04:37 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by crestone.coronasolutions.com (Postfix) with ESMTP id 1F1E3644B3B; Tue, 28 Aug 2007 13:04:34 -0600 (MDT) Received: from crestone.coronasolutions.com ([127.0.0.1]) by localhost (crestone.coronasolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04301-10; Tue, 28 Aug 2007 13:04:32 -0600 (MDT) Received: from mac.local (c-76-25-77-161.hsd1.co.comcast.net [76.25.77.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by crestone.coronasolutions.com (Postfix) with ESMTP id 23A00644882 for ; Tue, 28 Aug 2007 13:04:32 -0600 (MDT) Message-ID: <46D471BF.5040803@drivefaster.net> Date: Tue, 28 Aug 2007 13:04:31 -0600 From: Dan Harris User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: PostgreSQL Performance Subject: Re: Performance problem with table containing a lot of text (blog) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at coronasolutions.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/365 X-Sequence-Number: 26495 Kari Lavikka wrote: > Hello! > > Some background info.. We have a blog table that contains about eight > million blog entries. Average length of an entry is 1200 letters. > Because each 8k page can accommodate only a few entries, every query > that involves several entries causes several random seeks to disk. We > are having problems with queries like: > > 1) give me a list of months when I have written someting > 2) give me id's of entries I have written on month X year X > 3) give me the number of blog entries my friends have written since last > time I didn't see your schema, but couldn't these problems be solved by storing the article id, owner id, and blog date in a separate table? It seems that if you don't actually need the content of the blogs, all of those questions could be answered by querying a very simple table with minimal I/O overhead.