Re: Postgress is taking lot of CPU on our embedded hardware. - Mailing list pgsql-performance

From Deron
Subject Re: Postgress is taking lot of CPU on our embedded hardware.
Date
Msg-id CAF3Lvs4Wc-b+xS6b70deo=Yegwnvt61HVyLSyYHi5xu08iKtSg@mail.gmail.com
Whole thread Raw
In response to Re: Postgress is taking lot of CPU on our embedded hardware.  (Jayashankar K B <Jayashankar.KB@lnties.com>)
List pgsql-performance
Hello,

One thing you may look at are the index and constraints on the
relations.   If you have multiple constraints or index this may add
CPU time on each insert. You may try to drop the index, do a bulk
load, and then recreate the index.   This may (or may not) reduce the
total time / CPU  but it could allow you to push a bulk insert to a
specific time.    It would be good to use "COPY", or at least give it
a test to see if it is worth it.

If removing the index does significantly help with the insert, then
you may also try a different index (HASH or B-Tree, GIST).  It may be
possible that a specific index creation does not work efficiently on
that architecture...
http://www.postgresql.org/docs/9.1/static/sql-createindex.html

Deron



On Sat, Jan 28, 2012 at 10:21 AM, Jayashankar K B
<Jayashankar.KB@lnties.com> wrote:
> Hi,
>
> I downloaded the source code and cross compiled it into a relocatable package and copied it to the device.
> LTIB was the cross-compile tool chain that was used. Controller is  coldfire MCF54418 CPU.
> Here is the configure options I used.
>
> ./configure CC=/opt/freescale/usr/local/gcc-4.4.54-eglibc-2.10.54/m68k-linux/bin/m68k-linux-gnu-gcc
CFLAGS='-fmessage-length=0-fpack-struct -mcpu=54418 -msoft-float' --host=i686-pc-linux-gnu --target=m68k-linux-gnu
--prefix=/home/jayashankar/databases/Postgre_8.4.9_relocatable/
>
> Any other special flags that could be of help to us?
>
> Thanks and Regards
> Jayashankar
>
> -----Original Message-----
> From: Claudio Freire [mailto:klaussfreire@gmail.com]
> Sent: Saturday, January 28, 2012 7:54 AM
> To: Heikki Linnakangas
> Cc: Jayashankar K B; Andy Colson; pgsql-performance@postgresql.org
> Subject: Re: [PERFORM] Postgress is taking lot of CPU on our embedded hardware.
>
> On Fri, Jan 27, 2012 at 4:56 PM, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:
>> I don't think there's anything particular in postgres that would make
>> it a poor choice on a small system, as far as CPU usage is concerned
>> anyway. But inserting rows in a database is certainly slower than,
>> say, writing them into a flat file.
>
> How did you install postgres?
> Did you build it?
> Which configure flags did you use?
> Exactly which m68k cpu is it? (it does matter)
>
> For instance...
>
> wiki: "However, a significant difference is that the 68060 FPU is not pipelined and is therefore up to three times
slowerthan the Pentium in floating point applications" 
>
> This means, if you don't configure the build correctly, you will get really sub-optimal code. Modern versions are
optimizedfor modern cpus. 
> Of utmost importance, I would imagine, is the binary format chosen for pg data types (floating types especially, if
youuse them). 
>
>
> Larsen & Toubro Limited
>
> www.larsentoubro.com
>
> This Email may contain confidential or privileged information for the intended recipient (s) If you are not the
intendedrecipient, please do not use or disseminate the information, notify the sender and delete it from your system. 
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance

pgsql-performance by date:

Previous
From: Jayashankar K B
Date:
Subject: Re: Postgress is taking lot of CPU on our embedded hardware.
Next
From: Jeff Janes
Date:
Subject: Re: Postgress is taking lot of CPU on our embedded hardware.