Wednesday, February 08, 2006
RDBMS - Foreign key indexing
I always/only create an index on a foreign key whether:
1 - A deletion on the parent table is allowed and it triggers a cascade delete on the child table
2 - There's need to perform JOIN queries from the parent to the child
In the first situation, an unindexed foreign key will force a full table scan for each parent record deleted. In the second situation, a lack of the foreign key index in the child table will slow down join queries.
I rarely find suitable to create indexes on foreign keys in other situations though.
Tuesday, January 17, 2006
Oracle JDeveloper and backups
Yesterday I refactored a project I'm working on, including change of package names, renaming some java classes and functions and so on. Once I had all my sources organized, I thought that would be good to clean the directories where the old compiled class files reside. There's no need to do it manually as JDeveloper can do this for you; just go to the Run menu and execute Clean project (keep reading before trying!). Once finished I continued coding normally, but in the next build, the compiler complained about source files not found. What?! The cleaning process cleaned so deeply that even some (actually 6) of my source files had been completely wiped out of my hard disk.
Luckily, I had a recent backup and the lost files had just a few lines of code changed. I work with a laptop and I confess that I usually wait too much between backups. I've been very lucky this time; be careful if you can be affected by this issue and more important, keep regular backups, even if you work with a CVS.
I'm using JDeveloper build 10.1.3.34.12. It's an Early Access version and I'm convinced this issue will be solved in the final release.
On another note, I just use the IDE; I try to resist the temptation to stick to their frameworks and libraries because, although they're excellent pieces of software, they usually work better/only with a commercial Oracle product in the backend. If you're developing Java applications interacting with an Oracle database though, Oracle ADF (Application Development Framework, former BC4J) is a master piece of software that excels specially when used with complex relational data models.
[Update (2006-06-11)]: I've been using JDeveloper 10.1.3 (With Service Update 3) for some time and it works perfect; the 'cleaning too much' issue is no longer present. Suport for CVS (and Subversion too) is excellent. Nice.
Wednesday, November 16, 2005
What a wonderful world
I see them bloom for me and you
And I think to myself, what a wonderful world"
Louis Armstrong's song has come to my mind while visiting the Forests Forever website. You shoudn't miss it; it's worth a visit. You can enjoy really beautiful pictures of some of the most beautiful forests of our planet.
I don't feel like sending out a call for action, but it's good to know that at the moment we all can visit those -still real- places. It depends on us to keep them alive. Forever.
Thursday, November 10, 2005
On RDF
This weblog post can help you realize why the web needs to be semantically enabled. The author says that if you are looking for a hotel in New York City and you start searching for “New York Hotel” in a search engine, you’ll end up with wrong results like “The New York Hotel in Las Vegas” or “Hotel New York in Rotterdam”.
The promise of the Semantic Web & RDF is an improved Web where we could effectively find what we are really looking for.
Many people argue that the problem with RDF is its RDF/XML encoding; it’s difficult to read and thus stops people from using it. Although I agree completely (I understand RDF quite well but I often fail miserably when I have to write an RDF/XML document by hand), I think that there is another reason: For almost all users of the web, writing descriptive information of their web pages is not cool, metadata is not cool. HTML reached mass adoption because if I change a paragraph and hit F5, it appears the page updated in front of me. With metadata the benefits are not so evident.
In my opinion the big deal is to make metadata attractive for everyone. We should all be metadata addicted for the Semantic Web to arrive.
Having said that, I’m optimistic regarding the Semantic Web. If it doesn’t arrive, then I’ll be pessimistic about the future of the Web though. Some interesting things have happened recently in the Semantic Web arena; for instance the release of a new RDF query language and protocol by W3C (SPARQL) and some curiosities too like the fact that Google is hiring RDF guys...

