Re: [PERFORM] : Create table taking time

2011-09-29 Thread Venkat Balaji
We had performed VACUUM FULL and ANALYZE on the whole database. Yes, the CPU is ticking at 99-100% when i see the top command. But, we have 8 CPUs with 6 cores each. Thanks VB On Thu, Sep 29, 2011 at 12:44 AM, Scott Marlowe scott.marl...@gmail.comwrote: On Wed, Sep 28, 2011 at 11:06 AM,

[PERFORM] Select se bloquea

2011-09-29 Thread Numael Vacca Duran
Hola!! Tengo un serio inconveniente, estoy trabajando con postgresql 8.2 y tomcat 5.5.20 en un equipo con Centos 5.3 Y se me presenta un problema con una consulta, si la ejecuto le toma alrededores de 2.6 segundos la ejecución. pero en ocaciones se queda pegada esa consulta y luego para

Re: [PERFORM] : Create table taking time

2011-09-29 Thread Kevin Grittner
Venkat Balaji venkat.bal...@verse.in wrote: We had performed VACUUM FULL and ANALYZE on the whole database. Since you don't mention REINDEX, it seems likely that you've bloated your indexes (potentially including the indexes on system tables). That could lead to the symptoms you describe.

Re: [PERFORM] Select se bloquea

2011-09-29 Thread Claudio Freire
2011/9/29 Numael Vacca Duran numae...@hotmail.com: Hola!! Tengo un serio inconveniente, estoy trabajando con postgresql 8.2 y tomcat 5.5.20 en un equipo con Centos 5.3 1- 8.2 es viejito 2- Hacen falta muchos más datos. Las consultas en sí, un EXPLAIN y EXLAIN ANALYZE de las consultas,

[PERFORM] the number of child tables --table partitioning

2011-09-29 Thread Jian Shi
Hey, Is there a suggested number of child tables for table partitioning, I ran a stress test on a master table (with 800 thousand rows), trying to create 500,000 child tables for it, each child table has 2 indexes and 3 constraints (Primary key and foreign key). I wrote a script to do it:

Re: [PERFORM] the number of child tables --table partitioning

2011-09-29 Thread Kevin Grittner
Jian Shi j...@unitrends.com wrote: [moving the last sentence to the top] The system is 32-bit Linux, dual core, 4G memory. Postgres version is 8.1.21. Version 8.1 is out of support and doesn't perform nearly as well as modern versions.

Re: [PERFORM] : Create table taking time

2011-09-29 Thread Merlin Moncure
On Wed, Sep 28, 2011 at 12:06 PM, Venkat Balaji venkat.bal...@verse.in wrote: Hello Everyone, I am back with an issue (likely). I am trying to create a table in our production database, and is taking 5 seconds. We have executed VACUUM FULL and yet to run ANALYZE. Can i expect the CREATE

Re: [PERFORM] the number of child tables --table partitioning

2011-09-29 Thread Ondrej Ivanič
Hi, On 30 September 2011 01:08, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Is there a suggested number of child tables for table partitioning, Generally, don't go over about 100 partitions per table. Having 365 partitions per table is fine... -- Ondrej Ivanic

[PERFORM] Shortcutting too-large offsets?

2011-09-29 Thread Josh Berkus
All, Here's a case which it seems like we ought to be able to optimize for: datamart-# ORDER BY txn_timestamp DESC datamart-# LIMIT 200 datamart-# OFFSET 6000; QUERY PLAN --- Limit (cost=560529.82..560529.82 rows=1 width=145)

[PERFORM] array_except -- Find elements that are not common to both arrays

2011-09-29 Thread bricklen
I recently had need of an array_except function but couldn't find any good/existing examples. Based off the neat array_intersect function at http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Intersection_of_arrays, I put together an array_except version to return the array elements that are

Re: [PERFORM] postgres constraint triggers

2011-09-29 Thread Ben Chobot
On Sep 27, 2011, at 6:37 PM, Craig Ringer wrote: On 09/27/2011 12:54 PM, Ben Chobot wrote: My memory is fuzzy but as I recall, a possible downside to using deferred constraints was increased memory usage That's right. PostgreSQL doesn't currently support spilling of pending constraint

Re: [PERFORM] array_except -- Find elements that are not common to both arrays

2011-09-29 Thread Merlin Moncure
On Thursday, September 29, 2011, bricklen brick...@gmail.com wrote: I recently had need of an array_except function but couldn't find any good/existing examples. Based off the neat array_intersect function at http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Intersection_of_arrays , I put

Re: [PERFORM] array_except -- Find elements that are not common to both arrays

2011-09-29 Thread bricklen
On Thu, Sep 29, 2011 at 8:08 PM, Merlin Moncure mmonc...@gmail.com wrote: *) Prefer union all to union *) prefer array constructor to array_agg when not grouping. *) perhaps consider not reusing 'except' name with different semantic meaning Well done merlin (on phone in bed) Hi Merlin,

Re: [PERFORM] : Create table taking time

2011-09-29 Thread Venkat Balaji
I did not calculate the IO behavior of the server. What i noticed for the logs is that, the checkpoints are occurring too frequently each checkpoint is taking up to minimum 80 - 200+ seconds to complete write and checkpoint sync is taking 80 - 200+ seconds to sync, which is i believe IO