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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:01:35+00:00 2026-06-08T18:01:35+00:00

What is the difference between doing: SELECT * FROM table WHERE column IS NULL

  • 0

What is the difference between doing:

SELECT * FROM table WHERE column IS NULL

or –

SELECT * FROM table WHERE column = 0

Is doing IS NULL significantly worse off than equating to a constant?

The use case comes up where I have something like:

SELECT * FROM users WHERE paying IS NULL

(or adding an additional column)

SELECT * FROM users WHERE is_paying = 0
  • 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-06-08T18:01:38+00:00Added an answer on June 8, 2026 at 6:01 pm

    If I understand your question correctly, you are asking about the relative benefits/problems with the two situations:

    • where is_paying = 0
    • where paying is null

    Given that both are in the data table, I cannot think of why one would perform better than the other. I do think the first is clearer on what the query is doing, so that is the version I would prefer. But from a performance perspective, they should be the same.

    Someone else mentioned — and I’m sure you are aware — that NULL and 0 are different beasts. They can also behave differently in the optimization of joins and other elements. But, for simple filtering, I would expect them to have the same performance.

    Well, there is one technicaility. The comparison to “0” is probably built into the CPU. The comparison to NULL is probably a bit operation that requires something like a mask, shift, and comparison — which might take an iota of time longer. However, this performance difference is negligible when compared to the fact that you are reading the data from disk to begin with.

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

Sidebar

Related Questions

What would be the difference between doing: SELECT person FROM population WHERE id =
What is the difference between using SELECT ... INTO MyTable FROM... and INSERT INTO
I am trying to use PHP and MySQL's Create Table Select between two different
Is there any difference between doing this: $(.topHorzNavLink).click(function() { var theHoverContainer = $(#hoverContainer); var
What is the difference between doing a #include in a .h file and in
is there a performance difference between doing something like: void function() { char bufgfer[256];
Which is the difference between running a map reduce job doing /bin/hadoop -jar /file.jar
What's the difference between the functions plot and line in MATLAB? Are they doing
Is there any performance difference between dbms_lob.instr and contains or am I doing something
My model: function version() { $this->load->database(); $this->db->select('location_id'); $this->db->from('geo_blocks'); $this->db->where(2057793231 BETWEEN `ip_start` AND `ip_end`); echo

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.