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 BA8CB528A8 for ; Mon, 6 Jun 2005 13:15:26 -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 22551-09 for ; Mon, 6 Jun 2005 16:15:18 +0000 (GMT) Received: from mr1.surnet.cl (smtp1.surnet.cl [216.155.73.162]) by svr1.postgresql.org (Postfix) with ESMTP id 005385283A for ; Mon, 6 Jun 2005 13:15:17 -0300 (ADT) Received: from smtp1.surnet.cl (216.155.73.168) by mr1.surnet.cl (7.0.031.3) id 42587EDE00C283F9; Mon, 6 Jun 2005 12:14:44 -0400 Received: from smtp2.surnet.cl (smtp2.surnet.cl []) by mr1.surnet.cl ([216.155.73.168]); Mon, 06 Jun 2005 16:14:44 +0000 Received: from cluster.surnet.cl (216.155.73.164) by smtp2.surnet.cl (7.0.031.3) id 4259ADE3007670B6; Mon, 6 Jun 2005 12:15:32 -0400 Received: from localhost (200.85.216.119) by cluster.surnet.cl (7.0.024) id 4276578F004C7BDA; Mon, 6 Jun 2005 12:15:15 -0400 Received: by localhost (Postfix, from userid 1000) id B9F72C20F80; Mon, 6 Jun 2005 12:15:37 -0400 (CLT) Date: Mon, 6 Jun 2005 12:15:37 -0400 From: Alvaro Herrera To: Amit V Shah Cc: 'Jeffrey Tenny' , pgsql-performance@postgresql.org Subject: Re: Need help to decide Mysql vs Postgres Message-ID: <20050606161537.GB9595@surnet.cl> References: <0C072E7CC947D511AC9600A0CC7341200256CF36@xeon400.tagaudit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0C072E7CC947D511AC9600A0CC7341200256CF36@xeon400.tagaudit.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.637 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, FORGED_RCVD_HELO X-Spam-Level: * X-Archive-Number: 200506/117 X-Sequence-Number: 12754 On Mon, Jun 06, 2005 at 12:00:08PM -0400, Amit V Shah wrote: > I made a schema with 5 tables. I have a master data table with foreign keys > pointing to other 4 tables. Master data table has around 4 million records. > When I run a select joining it with the baby tables, > > postgres -> returns results in 2.8 seconds > mysql -> takes around 16 seconds !!!! (This is with myisam ... with innodb > it takes 220 seconds) PostgreSQL has an excellent query optimizer, so if you get a much better execution time than MySQL in complex queries this isn't at all unexpected. I assume the MySQL guys would tell you to rewrite the queries in certain ways to make it go faster (just like the Postgres guys tell people to rewrite certain things when they hit Postgres limitations.) -- Alvaro Herrera () "I would rather have GNU than GNOT." (ccchips, lwn.net/Articles/37595/)