Re: CPU usage when building a schema - Mailing list pgsql-novice

From Mladen Gogala
Subject Re: CPU usage when building a schema
Date
Msg-id 4C2202E5.7010802@vmsinfo.com
Whole thread Raw
In response to CPU usage when building a schema  (Deborah Fuentes <dfuentes@mhs.mphasis.com>)
Responses Re: CPU usage when building a schema  (Deborah Fuentes <dfuentes@mhs.mphasis.com>)
List 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@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@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@medo ~]$

It didn't even make a ripple. My Postgres is 8.4.4, Linux is CentOS 5.5:
mgogala@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@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


pgsql-novice by date:

Previous
From: Mladen Gogala
Date:
Subject: Re: Insert error
Next
From: Deborah Fuentes
Date:
Subject: Re: CPU usage when building a schema