Re: Postgress is taking lot of CPU on our embedded hardware.

From: Deron <fecastle(at)gmail(dot)com>
To: Jayashankar K B <Jayashankar(dot)KB(at)lnties(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Postgress is taking lot of CPU on our embedded hardware.
Date: 2012-01-28 17:56:54
Message-ID: CAF3Lvs4Wc-b+xS6b70deo=Yegwnvt61HVyLSyYHi5xu08iKtSg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)KB(at)lnties(dot)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(at)gmail(dot)com]
> Sent: Saturday, January 28, 2012 7:54 AM
> To: Heikki Linnakangas
> Cc: Jayashankar K B; Andy Colson; pgsql-performance(at)postgresql(dot)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(dot)linnakangas(at)enterprisedb(dot)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 slower than 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 optimized for modern cpus.
> Of utmost importance, I would imagine, is the binary format chosen for pg data types (floating types especially, if you use 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 intended recipient, 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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2012-01-28 18:16:27 Re: Postgress is taking lot of CPU on our embedded hardware.
Previous Message Jayashankar K B 2012-01-28 17:21:18 Re: Postgress is taking lot of CPU on our embedded hardware.