X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2702C4758E6 for ; Tue, 8 Apr 2003 23:18:47 -0400 (EDT) Received: from svana.org (svana.org [203.20.62.76]) by postgresql.org (Postfix) with ESMTP id 05C06474E42 for ; Tue, 8 Apr 2003 23:18:46 -0400 (EDT) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 19366h-0006mT-00; Wed, 09 Apr 2003 13:18:39 +1000 Date: Wed, 9 Apr 2003 13:18:39 +1000 From: Martijn van Oosterhout To: "Denis @ Next2Me" Cc: pgsql-performance@postgresql.org Subject: Re: [GENERAL] Yet Another (Simple) Case of Index not used Message-ID: <20030409031839.GE15928@svana.org> Reply-To: Martijn van Oosterhout References: <20030408234623.GD15928@svana.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3XA6nns4nE4KvaS/" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: X-Spam-Status: No, hits=-45.1 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/82 X-Sequence-Number: 1588 --3XA6nns4nE4KvaS/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 08, 2003 at 05:10:01PM -0700, Denis @ Next2Me wrote: > Interesting generic response. In other words, "it all depends". > Well, a de facto observation is: "In my case, it's always much slower wit= h, say, mysql". Curious, is mysql still so fast when you have transactions enabled? How does it deal with the following: begin; delete from bigtable; select count(*) from bigtable; -- Should return 0 abort; select count(*) from bigtable; -- Should give original size > Understand me, I don't mean to be starting a performance comparaison mysql > vs postgresql, which is probably an old subject, I am just looking for a > solution to solve this type of performance issues, ie the generic cases: > select count(*) from addresses where address is like 'pattern%'; > Which are very fast on mysql, and very slow on postgresql. Ah, but that may be caused by something else altogether. LIKE is only indexable in the C locale so if you have en_US as your locale, your LIKE won't be indexable. See the discussion threads on this mailing list in the = past. > Understood, it will always depend on some parameters, but the real > question is: how much control does one have over those parameters, and how > does one tweak them to reach optimal performance? Hmm, it depends. One person put it that mysql goes for performance first, then correctness, whereas postgresql goes for correctness first, then performance. Maybe fti (full text indexing) would work better? --=20 Martijn van Oosterhout http://svana.org/kleptog/ > "the West won the world not by the superiority of its ideas or values or > religion but rather by its superiority in applying organized violence. > Westerners often forget this fact, non-Westerners never do." > - Samuel P. Huntington --3XA6nns4nE4KvaS/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE+k5EPY5Twig3Ge+YRAiovAKCHfX0JXOzbUVfEIrnixz+XwZ1wYQCfWW39 OTdtMALGGZa5+0KFOpRhFjA= =s8Ph -----END PGP SIGNATURE----- --3XA6nns4nE4KvaS/--