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 E50B552832 for ; Fri, 24 Jun 2005 19:04:06 -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 41031-09 for ; Fri, 24 Jun 2005 22:04:01 +0000 (GMT) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6F66E5294F for ; Fri, 24 Jun 2005 19:03:56 -0300 (ADT) Received: from 209-161-193-22.dsl.look.ca (209-161-193-22.dsl.look.ca [209.161.193.22]) by tht.net (Postfix) with ESMTP id 0E45D76A15; Fri, 24 Jun 2005 18:03:33 -0400 (EDT) Subject: Re: Performance - moving from oracle to postgresql From: Rod Taylor To: Greg Maples Cc: pgsql-performance@postgresql.org In-Reply-To: <2F9239F5E316C54688FDA9814FF045D6AB0024@EXCHANGE.sf.nimblefish.com> References: <2F9239F5E316C54688FDA9814FF045D6AB0024@EXCHANGE.sf.nimblefish.com> Content-Type: text/plain Date: Fri, 24 Jun 2005 18:00:52 -0400 Message-Id: <1119650452.45024.90.camel@home> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.017 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/485 X-Sequence-Number: 13122 > There are some immediate questions from our engineers about performance > > "- Oracle has one particular performance enhancement that Postgres is > missing. If you do a select that returns 100,000 rows in a given order, > and all you want are rows 99101 to 99200, then Oracle can do that very > efficiently. With Postgres, it has to read the first 99200 rows and > then discard the first 99100. But... If we really want to look at > performance, then we ought to put together a set of benchmarks of some > typical tasks." > > Is this accurate: > accoring to > http://www.postgresql.org/docs/8.0/interactive/queries-limit.html > -- " The rows skipped by an OFFSET clause still have to be computed > inside the server; therefore a large OFFSET can be inefficient." Yes. That's accurate. First you need to determine whether PostgreSQLs method is fast enough for that specific query, and if the performance gains for other queries (inserts, updates, delete) from reduced index management evens out your concern. All performance gains through design changes either increase complexity dramatically or have a performance trade-off elsewhere. I find it rather odd that anyone would issue a single one-off select for 0.1% of the data about 99.1% of the way through, without doing anything with the rest. Perhaps you want to take a look at using a CURSOR? > Where is psql not appropriate to replace Oracle? Anything involving reporting using complex aggregates or very long running selects which Oracle can divide amongst multiple CPUs. Well, PostgreSQL can do it if you give it enough time to run the query, but a CUBE in PostgreSQL on a TB sized table would likely take significantly longer to complete. It's mostly just that the Pg developers haven't implemented those features optimally, or at all, yet. --