× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Pre-checking for existence doesn't always work. If you have a bunch of jobs adding to the file at the same time, there's a pretty good chance that between the time you pre-check and when you write the record, that some other job may beat you to the write.

On 12/14/2020 5:54 AM, Richard Schoen wrote:
Ah, I like that one for DB2. I'll have to check it out.

Dieter's comment about mostly-unique seems to make the case for always checking for record existence or at least somehow error handling correctly if there were an insert issue. One of the articles I read talked about having a retry in place in case an insert fails. I like pre-checking existence first whenever possible.

My main concerns these days are creating appropriate indexes for non-IBMi data like in MySql, Postgres or SQL Server.

The good thing about DB2 is it usually performs well if your relationships are in place and you have good queries 😊

On SQL Server and the like (where the DB runs often on a constrained Windows or Linux VM) it's going to be very dependent on memory and CPU of the VM where it's loaded so things get dicey pretty quickly if you're not careful.

As always there's never one way to do things the right way 😊

Thanks for the input. Happy holidays.

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx

----------------------------------------------------------------------

message: 1
date: Mon, 14 Dec 2020 05:38:58 +0100
from: "Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx>
subject: RE: The age-old database design question - Integers or
GUID/UUID for primary keys ? What are your thoughts ?

Have you ever had a look at the GENERATE_UNIQUE () function in SQL?

Excerpt from the SQL reference:
The GENERATE_UNIQUE function returns a bit data character string 13 bytes long (CHAR(13) FOR BIT DATA) that is unique compared to any other execution of the same function. The function is defined as non-deterministic.

I use this unique key in all of my tables that need a universally unique key, i.e. different customers write into the same table and finally we have to merge all this tables together.

Mit freundlichen Gr??en / Best regards

Birgitta Hauser


"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"
?Train people well enough so they can leave, treat them well enough so they don't want to.? (Richard Branson)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.