Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 5A83CC83CAD for ; Tue, 10 Jul 2012 03:27:59 -0300 (ADT) Received: from mx0.network-studio.com ([62.93.225.99]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SoTvO-0006Bg-NA for pgsql-performance@postgresql.org; Tue, 10 Jul 2012 06:27:58 +0000 Received: from zimbra-ne01.network-studio.com (zimbra-admin.network-studio.com [192.168.101.80]) by mx0.network-studio.com (Postfix) with ESMTP id 127EB408160; Tue, 10 Jul 2012 08:27:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra-ne01.network-studio.com (Postfix) with ESMTP id 0D2EFDA134F; Tue, 10 Jul 2012 08:27:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra-ne01.network-studio.com Received: from zimbra-ne01.network-studio.com ([127.0.0.1]) by localhost (zimbra-ne01.network-studio.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TSnrxxOjcOm3; Tue, 10 Jul 2012 08:27:40 +0200 (CEST) Received: from zimbra-ne01.network-studio.com (zimbra-ne01.network-studio.com [192.168.101.80]) by zimbra-ne01.network-studio.com (Postfix) with ESMTP id BCE0EDA1262; Tue, 10 Jul 2012 08:27:40 +0200 (CEST) Date: Tue, 10 Jul 2012 08:27:40 +0200 (CEST) From: Sylvain CAILLET To: Jeff Janes Cc: pgsql-performance@postgresql.org Subject: Re: Create tables performance Message-ID: <1629322e-0d80-4d27-941c-13a785c19387@zimbra-ne01.network-studio.com> In-Reply-To: Content-Type: multipart/alternative; boundary="=_c8d7d517-13ff-4d0f-bb8e-100a489bfd88" MIME-Version: 1.0 X-Originating-IP: [92.103.19.225] X-Mailer: Zimbra 7.1.3_GA_3374 (ZimbraWebClient - GC20 (Linux)/7.1.3_GA_3346) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/113 X-Sequence-Number: 47294 --=_c8d7d517-13ff-4d0f-bb8e-100a489bfd88 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Yes, you're right ! The process checks if all these tables exist before creating them. So it might be the SELECT that takes time. To check existence, I use the following query : select * from pg_tables where tablename='the_table'; May be it's not the best way. And I launch a query per table ! Not good at all. Thank you all, I will optimize this. Sylvain ----- Mail original ----- > On Sun, Jul 8, 2012 at 11:49 PM, Sylvain CAILLET > wrote: > > Hi, > > > > Thank you all for your help. > > > > @Jeff : my daemon creates these tables at start time so it doesn't > > do > > anything else at the same time. The CPU is loaded between 20% and > > 25%. > How does it decide which tables to create? Is it querying the > existing tables to figure out what new ones to make? Is the rest of > the time going to IO wait? > Cheers, > Jeff --=_c8d7d517-13ff-4d0f-bb8e-100a489bfd88 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <= div style=3D'font-family: Times New Roman; font-size: 10pt; color: #000000'= >Yes, you're right ! The process checks if all these table= s exist before creating them. So it might be the SELECT that takes time. To= check existence, I use the following query :
s= elect * from pg_tables where tablename=3D'the_table';
May be it's not the best way. And I launch a= query per table ! Not good at all.

Thank= you all, I will optimize this.

Sylvain


On Sun, Jul 8, 2012 at 11:49 PM, Sylvain= CAILLET <scaillet@alaloop.com> wrote:
> Hi,
>
> Th= ank you all for your help.
>
> @Jeff : my daemon creates these = tables at start time so it doesn't do
> anything else at the same tim= e. The CPU is loaded between 20% and 25%.

How does it decide which t= ables to create?  Is it querying the
existing tables to figure out = what new ones to make?  Is the rest of
the time going to IO wait?
Cheers,

Jeff

--=_c8d7d517-13ff-4d0f-bb8e-100a489bfd88--