LIKE operator and Underscore

Performance problem to be expected with LIKE-operator and underscore character being part of the query parameter, see a new example:

Assuming absolute majority of peoples are good, some are bad and few are ugly:


select * from folks where personality_type like 'THE_GOOD';
— the first fetch will return quickly

select * from folks where personality_type like 'THE_BAD'; -- slow

select * from folks where personality_type like 'THE_UGLY'; -- very slow

Thanks go to http://www.imdb.com/title/tt0060196/

 

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s