46
Hel8y
8y

A few weeks ago a client called me. His application contains a lot of data, including email addresses (local part and domain stored separately in SQL database). The application can filter data based on the domain part of the addresses. He ask me why sub.example.com is not included when he asked the application for example.com. I said: No problem, I can add this feature to the application, but the process will take a longer.

Client: No problem, please add this ASAP.

So, the next day I changed some of the SQL queries to lookup using the LIKE operator.

After a week the client called again: The process is really slow, how can this be?

Me: Well, you asked me to filter the subdomains as well. Before, the application could easily find all the domains (SQL index), but now it has to compare all the domains to check if it ends with the domain you are looking for.

Client: Okay, but why is it a lot slower than before?

Me: Do you have a dictionary in your office?

<Client search for a dictionary, came back with one>

Me: give me the definition of the word "time"

<Client gives definition of time>

Me: Give me the definition of all words ending with "time"

Client: But, ...

Never heard from him again on this issues :-P

Comments
  • 4
    Nice rant :)

    Lucene search for Java or .Net is just awesome if you want to do stuff like that super quick.
  • 2
    Genius.
  • 3
    I am totally using this example in the future!
  • 1
    A masterpiece of wit!
  • 0
    You could have just reversed the stored domains (xyz.domain.tld = tld.domain.xyz) and the used a prefix search.
Add Comment