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

  • Home
  • SEARCH
  • 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 6352413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:12:03+00:00 2026-05-24T22:12:03+00:00

I live in Australia, so postcodes are numeric and four digits long. In a

  • 0

I live in Australia, so postcodes are numeric and four digits long.

In a table steup by another person the postcode field has been setup as a VARCHAR(10) – strange i know!!!

There is a difference between the following two query times:
Postcode=’3000′
Postcode=3000

Both queries run, but the one with single quotes around it runs between 50% to 80% faster. Likewise postcode IN(‘3000′,’3001′,’3002’) is much faster than Postcode IN(3000,3001,3002). The postcode field is indexed

The quesiton is HOW do the single quotes make so much speed difference?

Can anyone shed any light on how the engine optimizes the above queries?

  • 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-24T22:12:05+00:00Added an answer on May 24, 2026 at 10:12 pm

    There is one important trap in this.
    If you use something like

     code = 1000
    

    instead of

    code = '1000'
    

    then if you had other dataset, the first case would return all records like:

     '1000', '1000A', '1000B'
    

    etc, while the second would return as expected only ‘1000’. This might be the reason of performance issue. Some mentioned that it converts int to varchar. I believe it converts all varchars to int and that is why it is noticable

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

Sidebar

Related Questions

I live in Australia and have not dealt much with imperial length measurements. How
I have a live db that has some 2011 dates that were entered as
On our live/production database I'm trying to add a trigger to a table, but
Live streaming video in html 5 - what is required from server to stream
Assumption: live/production web app suppresses errors being shown to end-users. Suppose your tech support
I live in Norway, and when i make Django apps i would like to
so live docs says this for calling .lenght() on an XML object For XML
We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing.
We need to capture live video and display easily on Linux. We need a
When developing (works fine live) the pages for our website don't pick up the

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.