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

The Archive Base Latest Questions

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

I have a table which holds the guid for an user and their actual

  • 0

I have a table which holds the guid for an user and their actual name as a string. I would like to grab some information based on an user. But which field should I use? Should my code say:

select * 
from userinboxcount 
where countDate >= startDate and countDate <= endDate and userid = '<guid here>'

or 

select * 
from userinboxcount 
where countDate >= startDate and countDate <= endDate and username = "FirstName LastName"
  • 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:41:02+00:00Added an answer on May 28, 2026 at 5:41 pm

    The biggest difference is if one field has an index that the database can use, and the other doesn’t. If the database has to read all the data in the table to scan for the value, the disk access takes so much resources that the difference in data type is not relevant.

    If both fields have indexes, then the index that is smaller would be somewhat faster, because it loads faster, and it’s more likely that it remains in the cache.

    Ideally you would have an index for all the fields in the condition, which has the fields that you want to return as included fields. That way the query can produce the result from only the index, and doesn’t have to read from the actual table at all. You should of course not use select *, but specify the fields that you actually need to return.

    Other than that, it would be somewhat faster to compare GUID values because it’s a simple numeric comparison and doesn’t have to consider lexical rules.

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

Sidebar

Related Questions

Suppose we have a table which holds information about person. Columns like NAME or
I have a sql table which holds information: id (hash) imagename string width int
I currently have a table called paper , which holds all the information for
HI I have a table which holds files and their types such as CREATE
In a SQL Server 2000 DB, I have a table which holds string representations
I have the following table which holds data on customers and staff. Would it
I have a base table called users which holds all common information about a
I have a table which holds information on television programs and I want to
I have a database table which holds each user's checkins in cities. I need
I have a table which holds clocking in/out records for every user : RecID

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.