Surrogate keys v/s natural keys

I am currently working on a database design problem. I work in the financial domain and I deal with data related to benchmarks and securities. The problem with such databases are that each security has multiple identifiers in the real world. They could be Uniquely identified by a SEDOL, CUSIP or ISIN or the many other type of identification standards available. This lead me to the question of designing the tables using a surrogate keys but I was still not sure how my team would react as they had already design loads based on real world identifiers and named it security_id. Unfortunately security_id could be a SEDOL, a CUSIP or ISIN or whatever depending on what region or benchmark the security belongs to. That isn’t really a reliable identifier. And hence to avoid annoying the guy in my team who does data loading I redesigned my queries to do some intelligent identifier resolutions. This cost us a lot. Queries that would perform in barely 500ms now take about 1500ms. ...

July 18, 2012 · 3 min · 472 words

Static in C++

Hey, its been a really long time. I couldn’t get my adsense account approved. It seems I need more content. If only I spend enough time blogging. Everyone gets busy once in a while. And everyone forgets that they have a blog. Especially ones like mine, where people rarely visit. Anyways, that’s relevant to what I wanted to make note of here. I was working on a minor change in my company’s C++ code base. Its a simple one for anyone who knows C++. But I don’t do much C++. The last time I remember writing real C++ code was during my university days. I mean my bachelors degree. During my masters I worked solely on Java based stuff for my projects and for a coursework, I just opted to do something in ASP .NET, just to get a feel of it. Coming straight back to the point. Static is an overused keyword. Literally it would mean something that doesn’t change. But in C++, this keyword has special meanings, depending on the context it is used. Static can be used for three purposes. One use is to have a variable defined that has a lifetime of the whole program. That is once you declare it static and initialize it, then that variable’s value can be accessed from anywhere in that program. That variable’s allocation is cleared up only when the program closes or quits. And it helps prevent re-initialization. If I were to write something like this: ...

July 18, 2012 · 4 min · 736 words