Barraca do Paulo
Hi, my name is Paulo, I am portuguese, and I am currently working as a freelance Software Engineer in Luxembourg. This is my personal blog, where I express my views in various subjects. You can contact me using barracadopaulo@gmail.com. Welcome!
7/6/09
Whatever Works
6/30/09
Real World Java EE Patterns
6/29/09
JavaFX and Open Office
6/23/09
To bind or not to bind
Therefore
select * from Table where X = 1
should be used instead of
select * from Table where X = :var
This way the database engine is able to calculate a better execution plan when compared to using bind variables.
6/14/09
SQL Tuning- how and who
The developer knows the functionality around the application and around the queries, and therefore knows how to re-write a query making it more performant but keeping the same result. The developer knows well SQL and will be able to fully use a range of tuning tools which will make the query faster. But most of the times the developer will look at his query as the center of the world. He will make it as fast as he can, ignoring any side effect on any other processes or queries running on the same database. The developer will be happy to tune his query even if it brings the database on its knees. He will proudly advertise the result of his work not caring about the fact that his gain cause higher losses on other processes.
The DBA has a more wider view on the database and can look to the query from a different perspective. He is capable of measuring the consequences of the tuning on the database and decide how far the process can go. He has a better knowledge of the database and can better improve the query. In the other hand, he normally knows little about the functionality or the business priorities, and therefore he will judge the tuning simply from the technical perspective. Maybe the query must take a big part of resources because it implements a business functionality which is by far a priority.
So the conclusion is that SQL tuning is a process where developers and DBAs must work closely in order to maximize performance, taking is consideration the business priorities, and measuring the impact of the process on the system as whole.
6/13/09
UNION versus UNION ALL
One more "go live"...
6/9/09
I miss Prolog....
Java Gotcha 5- Overriding flavors
class A {
public A m() {
return new A();
}
}
class B extends A {
public B m() {
return new B();
}
}
6/2/09
JavaOne
6/1/09
Java Gotcha 6- Mutable constants
Most of the developers assume that whenever the final keyword is used in a variable it indicates a constant, that is, a variable which gets assigned with an immutable value. That is not entirely correct, the final keyword, whenever applied to a variable, indicates that the variable can only get one value being assigned once.
public class MyClass {
private final int myVar;
private int myOtherVar = getMyVar();
private int andAnotherVar;
public MyClass() {
myVar = 10;
andAnotherVar = getMyVar();
}
public int getMyVar() {
return myVar;
}
public int getMyOtherVar() {
return myOtherVar;
}
public int getAndAnotherVar() {
return andAnotherVar;
}
public static void main(String args[]) {
MyClass mc = new MyClass();
System.out.println(mc.getMyVar());
System.out.println(mc.getMyOtherVar());
System.out.println(mc.getAndAnotherVar());
}
}
The previous code will print the sequence 10 0 10. Therefore, while dealing with final variables, we must distinguish the ones which have a value assigned at compile time, which work as constants, from the ones which get their values at runtime.
Archive
-
▼
2009
(44)
-
►
May
(8)
- Java Gotcha 5- Varargs and Arrays, Mutatis Mutandi...
- Java Gotcha 4- Look mom, no exception!
- Dev anti-pattern: Missing an index with a trimming...
- Java Gotcha 3- My Wrapper Types have an identity c...
- Shii - The Wii for Women
- Java Gotcha 2- Where is that NullPointerException ...
- Java Gotcha 1- Mad identifiers
- Java Gotchas
-
►
April
(15)
- Google Collections- Multimap
- "EJB 3.1 - A significant step towards maturity" in...
- "EJB 3.1 - A Significant Step Towards Maturity" on...
- EJB 3.1 - A Significant Step Towards Maturity- Com...
- EJB 3.1 - A Significant Step Towards Maturity
- Oracle wasn't sleeping
- Parleys
- Oracle buys Red Hat?
- Double Checked Locking
- Oracle Enterprise Pack for Eclipse and WebLogic 11...
- Adrenaline Junkies and Template Zombies: Understan...
- News of the day- IBM withdrew their offer to buy S...
- IBM Sun- Is Oracle sleeping?
- Interview with Rod Johnson
- On the move again
-
►
May
(8)