Re: [PERFORM] Delete performance

2011-06-01 Thread Jarrod Chesney
On 01/06/2011, at 11:45 AM, Jarrod Chesney wrote: > I'm executing 30,000 single delete statements in one transaction. > > At this point i'm looking into combining the multiple deletes into one > statement and breaking my big transaction into smaller ones of about 100 > deletes or so. > > On 0

Re: [PERFORM] CLUSTER versus a dedicated table

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 7:54 PM, Robert James wrote: > Hi.  I'm interested in understanding the differences between > CLUSTERing a table and making a dedicated one. > > We have a table with about 1 million records.  On a given day, only > about 1% of them are of interest.  That 1% changes every day

Re: [PERFORM] Problem query

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 6:28 PM, CS DBA wrote: > On 06/01/2011 03:38 PM, Kevin Grittner wrote: >> >> CS DBA  wrote: >> >>> The app wants to run a query like this: >>> >>> select count(pri_num) from max_xtrv_st_t >>> where pri_num in (select max(pri_num) from max_xtrv_st_t where 1=1 >>>            

Re: [PERFORM] CLUSTER versus a dedicated table

2011-06-01 Thread mark
> -Original Message- > From: pgsql-performance-ow...@postgresql.org [mailto:pgsql-performance- > ow...@postgresql.org] On Behalf Of Robert James > Sent: Wednesday, June 01, 2011 5:55 PM > To: pgsql-performance@postgresql.org > Subject: [PERFORM] CLUSTER versus a dedicated table > > Hi.

[PERFORM] Understanding Hash Join performance

2011-06-01 Thread Robert James
A query I has spends a long time on Hash Joins (and Hash Left Joins). I have a few questions: 1. When does Postgres decide to do a Hash Join, over another type of Join? 2. Do Hash Joins normally perform poorly? What can I do to speed them up? 3. What can I do to enable Postgres to use a faster ty

[PERFORM] CLUSTER versus a dedicated table

2011-06-01 Thread Robert James
Hi. I'm interested in understanding the differences between CLUSTERing a table and making a dedicated one. We have a table with about 1 million records. On a given day, only about 1% of them are of interest. That 1% changes every day (it's WHERE active_date = today), and so we index and cluster

Re: [PERFORM] Problem query

2011-06-01 Thread CS DBA
On 06/01/2011 03:15 PM, Merlin Moncure wrote: On Wed, Jun 1, 2011 at 3:14 PM, CS DBA wrote: Hi All; We have a table with approx 200 columns. about a dozen columns are text data types and the rest are a mix of integers , bigint's and double precision types. The table has about 25million rows.

Re: [PERFORM] Problem query

2011-06-01 Thread CS DBA
On 06/01/2011 03:38 PM, Kevin Grittner wrote: CS DBA wrote: The app wants to run a query like this: select count(pri_num) from max_xtrv_st_t where pri_num in (select max(pri_num) from max_xtrv_st_t where 1=1 group by tds_cx_ind, cxs_ind_2) Why not something

Re: [PERFORM] Problem query

2011-06-01 Thread Kevin Grittner
CS DBA wrote: > The app wants to run a query like this: > > select count(pri_num) from max_xtrv_st_t > where pri_num in (select max(pri_num) from max_xtrv_st_t where 1=1 > group by tds_cx_ind, cxs_ind_2) Why not something simpler? There are a number of possibi

Re: [PERFORM] Problem query

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 3:14 PM, CS DBA wrote: > Hi All; > > We have a table with approx 200 columns. about a dozen columns are text data > types and the rest are a mix of integers , bigint's and double precision > types. > > The table has about 25million rows. > > > The app wants to run a query li

[PERFORM] Problem query

2011-06-01 Thread CS DBA
Hi All; We have a table with approx 200 columns. about a dozen columns are text data types and the rest are a mix of integers , bigint's and double precision types. The table has about 25million rows. The app wants to run a query like this: select count(pri_num) from max_xtrv_st_t where pr

Re: [PERFORM] Strange behavior of child table.

2011-06-01 Thread Jeff Davis
On Tue, 2011-05-31 at 10:20 +0300, Jenish wrote: > Hi All, > > I have created partition on table Round_Action , which has 3 child > partition tables. > > > When I am firing a simple select query with limit on parent table it > is taking huge time to execute. But when I am firing this query > d

Re: [PERFORM] Speeding up loops in pl/pgsql function

2011-06-01 Thread Merlin Moncure
On Wed, Jun 1, 2011 at 4:19 AM, Reuven M. Lerner wrote: > Hi, everyone. > > First of all, thanks for all of your help several days ago.  The > improvements to our program were rather dramatic (in a positive sense). > > Based on the help that everyone gave, I'm working on something similar, > tryin

Re: [PERFORM] Speeding up loops in pl/pgsql function

2011-06-01 Thread Reuven M. Lerner
Hi, everyone. First of all, thanks for all of your help several days ago. The improvements to our program were rather dramatic (in a positive sense). Based on the help that everyone gave, I'm working on something similar, trying to use regexp_replace to transform a string into the result of