Re: CPU usage when building a schema

From: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>
To: Deborah Fuentes <dfuentes(at)mhs(dot)mphasis(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: CPU usage when building a schema
Date: 2010-06-23 12:49:41
Message-ID: 4C2202E5.7010802@vmsinfo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Deborah Fuentes wrote:
>
> Hello,
>
>
>
> I’m new to Postgres so I apologize in advance for the simple question….
>
>
>
> Why is it when I’m building an empty schema does Postgres consume all
> the CPU resources? My experience is with Informix and I’ve never seen
> anything like this.
>
>
>
> Thanks!
>
> Deb
>
What kind of a machine are you using? What OS, version and architecture?
What Postgres version? If Linux, did you do "strace" to see what is
going on? You can even compile PgSQL with the "-g" flag and use gprof
to find out where the time is spent. Furthermore, what do you mean by
"building an empty schema"? Are we talking about "create schema" command
or something else? I tried creating an empty schema and it wasn't even
visible on CPU:
[mgogala(at)medo ~]$ psql
Timing is on.
psql (8.4.4)
Type "help" for help.

mgogala=# create schema test;
CREATE SCHEMA
Time: 192.082 ms
mgogala=# drop schema test;
DROP SCHEMA
Time: 59.451 ms
mgogala=#

Simultaneously, in another window I did this:
[mgogala(at)medo ~]$ sar -u 3 15
Linux 2.6.18-194.3.1.el5.centos.plusPAE (medo) 06/23/2010

08:45:43 AM CPU %user %nice %system %iowait
%steal %idle
08:45:46 AM all 3.00 0.00 0.83 1.50
0.00 94.68
08:45:49 AM all 2.17 0.00 0.67 0.00
0.00 97.16
08:45:52 AM all 2.16 0.00 1.00 0.00
0.00 96.84
08:45:55 AM all 2.50 0.00 1.50 3.00
0.00 93.01
08:45:58 AM all 2.34 0.00 0.33 0.00
0.00 97.33
08:46:01 AM all 0.67 0.00 0.50 1.00
0.00 97.83

[mgogala(at)medo ~]$

It didn't even make a ripple. My Postgres is 8.4.4, Linux is CentOS 5.5:
mgogala(at)medo ~]$ uname -a
Linux medo 2.6.18-194.3.1.el5.centos.plusPAE #1 SMP Wed May 19 10:00:02
EDT 2010 i686 athlon i386 GNU/Linux
[mgogala(at)medo ~]$
What versions of OS and DB do you have? Do you have an OS or are you
running Windows?

--
Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
www.vmsinfo.com

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Deborah Fuentes 2010-06-23 16:27:25 Re: CPU usage when building a schema
Previous Message Mladen Gogala 2010-06-23 12:40:32 Re: Insert error