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 7180329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:19:27+00:00 2026-05-28T17:19:27+00:00

Situation: I am trying to write a efficient query using "LIKE" statement to look

  • 0

Situation:

I am trying to write a efficient query using "LIKE" statement to look after a piece of text into a column with short texts.

Model:

Table 'EVENTSGENERAL' : { ID (KEY), GENERATOR_ (FK), DATETIME, COMPUTERNAME, OSLOGIN, DBLOGIN, INFOTYPE, INFO }

Table 'EVENTSGENERATORS' : { ID (KEY), GENERATOR_ (FK), SHORTNAME, LONGNAME }

Table 'EVENTSINFOTYPES'  : { ID (KEY), GENERATOR_ (FK), VERSION_, INFOTYPE, DESCRIPTION }

Indexes : EVENTSGENERAL.GENERATOR, EVENTSGENERAL.DATETIME, EVENTSINFOTYPES.INFOTYPE
All Ascending.

My Query:

SELECT FIRST @first SKIP @skip A.ID,B.LONGNAME,  A.DATETIME, A.COMPUTERNAME,A.OSLOGIN, A.DBLOGIN, C.DESCRIPTION, A.INFO
FROM EVENTSGENERAL A JOIN EVENTSGENERATORS B ON B.GENERATOR_ = A.GENERATOR_
JOIN EVENTSINFOTYPES C ON C.GENERATOR_ = A.GENERATOR_ AND C.INFOTYPE = A.INFOTYPE
WHERE C.DESCRIPTION LIKE '%VALUE%'

Problem:

This query will run on very large databases. Is there any way I can improve it? I am using a Firebird database.

  • 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-28T17:19:28+00:00Added an answer on May 28, 2026 at 5:19 pm

    No, unfortunately not, because you use wildcards (%) on both sides of the LIKE keyword. The leading (beginning) wildcard means that no index can be used to help improve the search speed, and therefore every row has to be examined to see if it meets the criteria.

    You can speed things up somewhat by changing to LIKE 'VALUE%' instead; an index can at least be used to limit the rows being searched to those starting with VALUE.

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

Sidebar

Related Questions

I am trying to query 2 tables using the following sql statement in an
I am trying to achieve a situation where i load a file into the
I am trying to write an app in python to control a motor using
I'm trying to write a Python script for searching out duplicate mp3/4 files using
I'm trying to write a C# repository with atomic contexts and feel like this
Simple situation. I'm trying to write my own blog with a minor twist. Part
I have the following situation. I am trying to write a unit test for
I'm trying to write a voip app for Android, using the Android SIP API
Situation: I'm trying run an https store (xcart) under one domain secure.example.com and I
The situation I'm trying to solve: in my Cocoa app, I need to encrypt

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.