Topic: SQL and Big-O

I think this is a simple question, I think I might know the answer already but I'd rather ask and be sure than keep wondering for a while tongue
Here goes,

N = size of 'users' database.
If ID is the primary key in the user's database, it would take Big-O(1) to retrieve a user by it's ID whereas it would take Big-O(N) to retrieve a user by it's name.
Now that's what I'm thinking, am I right?

Thank you smile

2

Re: SQL and Big-O

I have practically no idea what you mean. What you have written makes very little sense.

Re: SQL and Big-O

I found this interesting discussion which I believe generally addresses this question...
http://www.experts-exchange.com/Program … 01575.html

TwoHawks
Love is the Function
No Form is the Tool

Re: SQL and Big-O

thanks, link is good idea