Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Dimitri Fontaine Newsgroups: comp.databases.postgresql Subject: Re: the performance cost of a postgresql key violation exception Date: Sun, 20 Jul 2014 14:51:18 +0200 Organization: A noiseless patient Spider Lines: 13 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="b4cd7ce2dcd601d09567d71a2b24a9e9"; logging-data="18251"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18InKer6tIvTbQdqBLrB3o2" User-Agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.91 (darwin) Cancel-Lock: sha1:AdY3cZv0ox7PJQHUHlfx4OzjCrQ= sha1:G8gUH98zpd5lQM8yb7phisqreu4= Xref: csiph.com comp.databases.postgresql:577 stoicism1@aol.com writes: > org.postgresql.util.PSQLException: ERROR: duplicate key value > violates unique constraint "reports_uniqueness_index" > > What is the cost performance of this? For PostgreSQL, an index lookup that it has to do anyway for inserting the new row at the right place. For your application, I don't know, you have to make some tests. -- Dimitri Fontaine PostgreSQL DBA, Architecte