Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D279E6329AA for ; Fri, 11 Dec 2009 17:58:10 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 15379-10 for ; Fri, 11 Dec 2009 21:57:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f219.google.com (mail-ew0-f219.google.com [209.85.219.219]) by mail.postgresql.org (Postfix) with ESMTP id 855EB632515 for ; Fri, 11 Dec 2009 17:57:59 -0400 (AST) Received: by ewy19 with SMTP id 19so1526847ewy.21 for ; Fri, 11 Dec 2009 13:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/kGEEW3rQBI9iphXK0KLTkH81Z4uEMf8d5lxlC+Aiqw=; b=MaxW+DiTUb0cxQM6663s/tLNW0nb5J0IfTn9UafGcuzos39PrpEy3G7fsCFzXVoW9b zksGEFlHM+a8fc3tTPLfYRn6lLU8Q/x5B4YO5E62JuSOT3vG7KTiuZvs72yXtZyeQfyP TdvkHE7Y3b/ip0i2Lm0OqIR/aJ7pHRela/WhM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=BjA4kB1+4njbqVrWAmGT2K7Nva0rPs3xMR+binFLeqdt/q9jNRD6AJLQ5ak1/mQ1C5 nwi9fl81LunvL3hnC1M4P8LarZEVSVjFXJb5cDZxXBLu4hQB+ywXQzERoplRK4Afo+SA ZdSyQdT94FeBv21ZhHg1eYiSd2VTDfVjoj01E= MIME-Version: 1.0 Received: by 10.216.85.130 with SMTP id u2mr797534wee.135.1260568677330; Fri, 11 Dec 2009 13:57:57 -0800 (PST) In-Reply-To: References: <4427a97a0912101235x3ade510blcc00d5ce9883c6b6@mail.gmail.com> <200912102256.59868.andres@anarazel.de> <4427a97a0912101401kb29e1a5ic5424d6d0b7efe62@mail.gmail.com> <200912102309.04057.andres@anarazel.de> <1260554319.2611.10.camel@jd-desktop.unknown.charter.com> <1260564610.2611.41.camel@jd-desktop.unknown.charter.com> Date: Fri, 11 Dec 2009 14:57:56 -0700 Message-ID: Subject: Re: 8.4.1 ubuntu karmic slow createdb From: Scott Marlowe To: Nikolas Everett Cc: jd@commandprompt.com, Andres Freund , pgsql-performance@postgresql.org, Michael Clemmons Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.522 tagged_above=-10 required=5 tests=AWL=0.077, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/155 X-Sequence-Number: 36769 On Fri, Dec 11, 2009 at 2:39 PM, Nikolas Everett wrote: > > > On Fri, Dec 11, 2009 at 3:50 PM, Joshua D. Drake > wrote: >> >> On Fri, 2009-12-11 at 15:43 -0500, Nikolas Everett wrote: >> > Turning fsync off on a dev database is a bad idea? =A0Sure you might >> > kill it and have to start over, but thats kind of the point in a dev >> > database. >> >> My experience is that bad dev practices turn into bad production >> practices, whether intentionally or not. > > Fair enough.=A0 I'm of the opinion that developers need to have their uni= t > tests run fast.=A0 If they aren't fast then your just not going to test a= s > much as you should.=A0 If your unit tests *have* to createdb then you hav= e to > do whatever you have to do to get it fast.=A0 It'd probably be better if = unit > tests don't create databases or alter tables at all though. This is my big issue. dropping / creating databases for unit tests is overkill. Running any DDL at all for a unit test seems wrong to me too. Insert a row if you need it, MAYBE. Unit tests should work with a test database that HAS the structure and database already in place. What happens if your unit tests get lose in production and drop a database, or a table. Not good.