pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedConstraint Error effect on PostgreSQL
2+ messages / 2 participants
[nested] [flat]
* Constraint Error effect on PostgreSQL
@ 2006-03-13 11:25 Christian Paul B. Cosinas <cpc@cybees.com>
0 siblings, 1 reply; 2+ messages in thread
From: Christian Paul B. Cosinas @ 2006-03-13 11:25 UTC (permalink / raw)
To: pgsql-sql
Hi Fellow PostgreSQL users,
Just a question here.
Is there any bad effect on the PostgreSQL performance If I encounter many
fails on inserting records to database with primary key column.
For example I have this table
CREATE TABLE unique_items
(
item_id text NOT NULL,
CONSTRAINT unique_items_pkey PRIMARY KEY (item_id),
CONSTRAINT unique_item_id_fk FOREIGN KEY (item_id)
REFERENCES items (item_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
WITH OIDS;
With these valu:
Unique items
------------
Item001
Then I have a program that insert 1(one) million times like this:
Insert into unique_items(item_id) values('Item001)
Ofcourse we all know that it will fail because there is already a record in
the database.
Would there be any bad effect on the database or none?
Regards,
Ian
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Constraint Error effect on PostgreSQL
@ 2006-03-13 17:39 Richard Huxton <dev@archonet.com>
parent: Christian Paul B. Cosinas <cpc@cybees.com>
0 siblings, 0 replies; 2+ messages in thread
From: Richard Huxton @ 2006-03-13 17:39 UTC (permalink / raw)
To: Christian Paul B. Cosinas <cpc@cybees.com>; +Cc: pgsql-sql
Christian Paul B. Cosinas wrote:
>
> Then I have a program that insert 1(one) million times like this:
> Insert into unique_items(item_id) values('Item001)
>
> Ofcourse we all know that it will fail because there is already a record in
> the database.
>
> Would there be any bad effect on the database or none?
No long-term effects. Obviously it takes time to run one million queries
even if they are all inserts that fail.
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-03-13 17:39 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-13 11:25 Constraint Error effect on PostgreSQL Christian Paul B. Cosinas <cpc@cybees.com>
2006-03-13 17:39 ` Richard Huxton <dev@archonet.com>
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