I have written a complex oracle sql query and the explain plan stats look like this: Cost: 209,201 Bytes:187,944,150 Cardinality: 409,675
Now the DBA tuned the query and the stats look like this: Cost: 42,996 Bytes: 89,874,138 Cardinality: 209,226
My first question is, if the numbers are lower, does it automatically mean better performance? Which number is the most pertient?Cost/Cardinality/Bytes? My second question is: I understand cardinality is the number of rows read. But when i run the query, it returns '0' rows ! My impression was that Cardinality has to be same for two queries that are supposed to return same result sets. This I guess is wrong?