X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CFD29D1B1E3 for ; Thu, 3 Jun 2004 15:27:45 -0300 (ADT) 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 41723-02 for ; Thu, 3 Jun 2004 18:27:46 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 240FAD1B1F8 for ; Thu, 3 Jun 2004 15:27:44 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i53IRiVU008905; Thu, 3 Jun 2004 14:27:44 -0400 (EDT) To: Joseph Turner Cc: pgsql-sql@postgresql.org Subject: Re: Selecting "sample" data from large tables. In-reply-to: <200406031131.24535.joseph.turner@oakleynetworks.com> References: <200406031131.24535.joseph.turner@oakleynetworks.com> Comments: In-reply-to Joseph Turner message dated "Thu, 03 Jun 2004 11:31:22 -0600" Date: Thu, 03 Jun 2004 14:27:44 -0400 Message-ID: <8904.1086287264@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200406/26 X-Sequence-Number: 17971 Joseph Turner writes: > I have a table with a decent number of rows (let's say for example a > billion rows). I am trying to construct a graph that displays the > distribution of that data. However, I don't want to read in the > complete data set (as reading a billion rows would take a while). Can > anyone thing of a way to do this is postgresql? There is a fairly decent random-sampling engine inside ANALYZE, but no way for the user to get at it :-(. Can you make any use of ANALYZE's results, viz the pg_stats view? regards, tom lane