Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4112968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:15:48+00:00 2026-05-20T22:15:48+00:00

My company database has 20 different string formats for their primary product label. All

  • 0

My company database has 20 different string formats for their primary product label. All 20 of them are stored in a separate look-up table

1 are strings starting with ‘W’

2 are strings starting with ‘TAIC’

3 are strings starting with ‘D’

…

Next to the label attribute is the ‘type’ attribute, which stores the number related to which prefix the label contains.

I’m tasked with updating one of our modules for better runtime. One of the queries I ran across deals with all labels containing ‘TAIC’ as the prefix. However, instead of comparing whether the type number is equal to 2, it runs a LIKE operation checking for each label that begins with TAIC.

Now, my question is this — since my goal is for better run time, would it be wise to switch from the like operator to just a regular equality operation against the type attribute? It seems that running a regular expression-ish operation against a string would be a bit more time consuming, but enough to significantly alter the run time of a system?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:15:48+00:00Added an answer on May 20, 2026 at 10:15 pm

    In Oracle, both these operations:

    SELECT  *
    FROM    mytable
    WHERE   pk LIKE 'TAIC%'
    

    and

    SELECT  *
    FROM    mytable
    WHERE   type = 2
    

    are sargable, that is able to use an index on the appropriate fields.

    The numeric index, however, would be more compact and hence require less time to traverse, so using numeric comparison could increase the query performance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My company has developed a long standing product using MFC in Visual C++ as
I am trying to build a SQL 2005 database that has a Company data
I have 67 different databases and each database has more than one common table.
Our company has 4 business entities, so I have created 4 different databases for
My company has a number of relatively small Access databases (2-5MB) that control our
My company performed a data migration recently (in a SQL Server 2005 database) and
So my company stores alot of data in a foxpro database and trying to
A while ago, I set up my company's local (non-internet) client database on my
The company I used to work with has two developers working fulltime, and a
I'm developing a cms for a company that has multiple regional sites (us, uk,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.