pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Regarding ALTER Command
4+ messages / 3 participants
[nested] [flat]

* Regarding ALTER Command
@ 2006-06-07 12:43  soni de <soni.de@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: soni de @ 2006-06-07 12:43 UTC (permalink / raw)
  To: pgsql-performance

Hello,



We have database on which continueous operations of INSERT, DELETE, UPDATE
are going on, In the mean time irrespective of INSERT and UPDATE we want to
ALTER some filelds from the table can we do that?

Would the ALTER command on heavily loaded database create any perfomance
problem?

Is it feasible to do ALTER when lots of INSERT operations are going on?



Postgresql version we are using is -- PostgreSQL 7.2.4



Please provide me some help regarding this.



Thanks,

Soni

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Regarding ALTER Command
@ 2006-06-07 14:50  Jim C. Nasby <jnasby@pervasive.com>
  parent: soni de <soni.de@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Jim C. Nasby @ 2006-06-07 14:50 UTC (permalink / raw)
  To: soni de <soni.de@gmail.com>; +Cc: pgsql-performance

On Wed, Jun 07, 2006 at 06:13:11PM +0530, soni de wrote:
> Hello,
> 
> 
> 
> We have database on which continueous operations of INSERT, DELETE, UPDATE
> are going on, In the mean time irrespective of INSERT and UPDATE we want to
> ALTER some filelds from the table can we do that?
> 
> Would the ALTER command on heavily loaded database create any perfomance
> problem?
> 
> Is it feasible to do ALTER when lots of INSERT operations are going on?
 
The problem you'll run into is that ALTER will grab an exclusive table
lock. If *all* the transactions hitting the table are very short, this
shouldn't be too big of an issue; the ALTER will block all new accesses
to the table while it waits for all the pending ones to complete, but if
all the pending ones complete quickly it shouldn't be a big issue.

If one of the pending statements takes a long time though...
 
> Postgresql version we are using is -- PostgreSQL 7.2.4

You very badly need to upgrade. 7.2 is no longer supported, and there
have been over a half-dozen data loss bugs fixed since then.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Regarding ALTER Command
@ 2006-06-08 06:07  soni de <soni.de@gmail.com>
  parent: Jim C. Nasby <jnasby@pervasive.com>
  0 siblings, 1 reply; 4+ messages in thread

From: soni de @ 2006-06-08 06:07 UTC (permalink / raw)
  To: Jim C. Nasby <jnasby@pervasive.com>; +Cc: pgsql-performance

Hello,


We are planning to use latest postgres version. I have one query as below:



One more thing I have to mention is that we are using 2 postmasters running
on different machines and both are accessing same data directory. (i.e both
the machines uses same tables or the databases)

In that case if from first machine, continuous INSERT operation on any table
are going on and from the second we have to update the same table using
ALTER command.

Would this create any problem because INSERT and ALTER operations are
executed from the two different postmasters but for a same data directory?

Would there be any data loss or in this case also ALTER will block all the
new accesses to the table?


Thanks,
Soni


On 6/7/06, Jim C. Nasby <jnasby@pervasive.com> wrote:
>
> On Wed, Jun 07, 2006 at 06:13:11PM +0530, soni de wrote:
> > Hello,
> >
> >
> >
> > We have database on which continueous operations of INSERT, DELETE,
> UPDATE
> > are going on, In the mean time irrespective of INSERT and UPDATE we want
> to
> > ALTER some filelds from the table can we do that?
> >
> > Would the ALTER command on heavily loaded database create any perfomance
> > problem?
> >
> > Is it feasible to do ALTER when lots of INSERT operations are going on?
>
> The problem you'll run into is that ALTER will grab an exclusive table
> lock. If *all* the transactions hitting the table are very short, this
> shouldn't be too big of an issue; the ALTER will block all new accesses
> to the table while it waits for all the pending ones to complete, but if
> all the pending ones complete quickly it shouldn't be a big issue.
>
> If one of the pending statements takes a long time though...
>
> > Postgresql version we are using is -- PostgreSQL 7.2.4
>
> You very badly need to upgrade. 7.2 is no longer supported, and there
> have been over a half-dozen data loss bugs fixed since then.
> --
> Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
> Pervasive Software      http://pervasive.com    work: 512-231-6117
> vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Regarding ALTER Command
@ 2006-06-08 15:04  Tom Lane <tgl@sss.pgh.pa.us>
  parent: soni de <soni.de@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2006-06-08 15:04 UTC (permalink / raw)
  To: soni de <soni.de@gmail.com>; +Cc: Jim C. Nasby <jnasby@pervasive.com>; pgsql-performance

"soni de" <soni.de@gmail.com> writes:
> One more thing I have to mention is that we are using 2 postmasters running
> on different machines and both are accessing same data directory. (i.e both
> the machines uses same tables or the databases)

The above is guaranteed NOT to work.  I'm surprised you haven't already
observed wholesale data corruption.  But don't worry, you will soon.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-06-08 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-07 12:43 Regarding ALTER Command soni de <soni.de@gmail.com>
2006-06-07 14:50 ` Jim C. Nasby <jnasby@pervasive.com>
2006-06-08 06:07   ` soni de <soni.de@gmail.com>
2006-06-08 15:04     ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox