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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:20:29+00:00 2026-05-26T09:20:29+00:00

I am working on a side project that is quite an undertaking; my question

  • 0

I am working on a side project that is quite an undertaking; my question regards the efficiency gained when using a BOOLEAN value to determine whether or not further data processing is required.

For example: If I had a table that listed all the creatures. In another table that was relational in nature listed their hibernation period, and calories consumed each day during hibernation.

Is it efficient to have inside the (Creatures) table a value for “hibernates” BOOLEAN.

If true then go to the “hibernation_creature_info_relations” table and find the creature with that ID and return that information.

This means that for all the creatures whose value for “hibernates” = false will prevent SQL from having to search through the large table of “hibernation_creature_info_relations.”

Or when using ID’s is the process so fast in checking the “hibernation_creature_info_relations” table so fast that there will actually be a larger impact on performance by having to process the argument of doing what based on if the value of hibernation is set to true or false?

I hope this was enough information to help you understand what I am asking, if not please let me know so I can rephrase or include more details.

  • 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-26T09:20:30+00:00Added an answer on May 26, 2026 at 9:20 am

    No, that is not a good way to do things.

    Use a normal field that can be null instead.

    Example

    table creatures
    ---------------
    id     name      info_id
    
    1      dino      null
    2      dog       1
    3      cat       2
    
    table info
    --------------
    id     info_text
    
    1      dogs bark
    2      cats miauw
    

    Now you can just do a join:

    SELECT c.name, i.info_text
    FROM creature c
    LEFT JOIN info i ON (c.info_id = i.id)
    

    If you do it like this, SQL can use an index.
    No SQL database will create an index on a boolean field.
    The cardinality of that field is too low and using indexes on low cardinality fields slows things down instead of speeding things up.

    See: MySQL: low cardinality/selectivity columns = how to index?

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

Sidebar

Related Questions

I'm working on a server-side project that consists of several services. Each service is
I'm working on a side project that would be a simple web application to
The project that I'm currently working on, is large scale. I'm using email activation
Currently I'm working on Web project that is built using ASP.NET Web Forms. We
So I'm working on a side project using MySQL/MyBatis3/Tomcat. I'm currently working on turning
I'm working on a project that will generate an OAuth querystring in JavaScript, using
I'm working on a side project right now for an email client. I'm using
Currently I'm working on a project that needs me to have 2 div's side
I am currently working on a small side-project in MVC3. The goal is to
I've been working on a web app in Clojure as a side project, and

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.