Hi,
could anyone tell me if it makes a difference to Oracle 10g whether I use:
SELECT col1 FROM myTable WHERE col2 = 'someval' AND col3 = "someotherval"
or
SELECT col1 FROM
SELECT col1, col2, col3 FROM (
SELECT * FROM myTable
) WHERE col2 = 'someval'
) WHERE col3 = "someotherval"
According to the explain plan, the cost for the above is the same, but Im a blank when it comes to performance measurement.
Background is: in my application, I have several basic queries that I need to modify by arbitrary criteria at runtime to provide datasets for different clients. The WHERE conditions and fetched columns are specific to a client configuration file and some configs may require looking in col2 while others look in col5 and so on. In addition, users may add additional criteria and columns on top of the client configuration. I was thinking of using a set of decorators to achieve this, so if the above is the same performance wise, I could keep all three query parts cleanly separated.
It's an Oracle 10g. There is some hundred thousand rows in the table (actually it is a View).
Thanks for any suggestions.