X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D72DB538E9 for ; Tue, 29 Mar 2005 20:08:36 +0100 (BST) 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 56560-02 for ; Tue, 29 Mar 2005 19:08:27 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id C975A53465 for ; Tue, 29 Mar 2005 20:08:25 +0100 (BST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j2TJ8F2L001236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Mar 2005 12:08:18 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j2TJ8FfD015539; Tue, 29 Mar 2005 12:08:15 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j2TJ8FIX015538; Tue, 29 Mar 2005 12:08:15 -0700 (MST) (envelope-from mfuhr) Date: Tue, 29 Mar 2005 12:08:15 -0700 From: Michael Fuhr To: Vinicius Bernardi Cc: pgsql-performance@postgresql.org Subject: Re: Million of rows Message-ID: <20050329190815.GA15447@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/644 X-Sequence-Number: 11349 On Tue, Mar 29, 2005 at 03:33:24PM -0300, Vinicius Bernardi wrote: > > But now the problem starts when I has to select data from this > vehicles about the history ( I store only 2 months ) something like 40 > or 50 millions of data about 500 vehicles. > > Using the keys VEHICLE_ID and GPS_TIME, the perfomance is very low... Please post an example query and the EXPLAIN ANALYZE output. The table definition might be useful too. > I need some ideas for a better perfomance in this table Do you have indexes where you need them? Do you cluster on any of the indexes? Do you VACUUM and ANALYZE the database regularly? Have you investigated whether you need to increase the statistics on any columns? Have you tuned postgresql.conf? What version of PostgreSQL are you using? -- Michael Fuhr http://www.fuhr.org/~mfuhr/