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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:39:28+00:00 2026-06-12T17:39:28+00:00

Here are two example queries: SELECT NOW(), NOW() + INTERVAL 1 HOUR + INTERVAL

  • 0

Here are two example queries:

SELECT NOW(), NOW() + INTERVAL 1 HOUR + INTERVAL 1 MINUTE + INTERVAL 1 SECOND;
SELECT NOW(), ADDTIME( NOW(), '1:01:01' );

Is there any difference at all between these two queries? I mean, in performance or best practice uses ?

As far as I tested, the INTERVAL one seems to have slightly longer execution times.

EDIT: The result for 100’000 loops almoust always came out something like this:

Interval:  8.5930590629578 seconds.
Addtime:   8.2951309680939 seconds.

 

SELECT NOW(), NOW() + 3661 SECOND;

Single interval:  8.3964569568634 seconds.
Interval:         9.1104879379272 seconds.
Addtime:          8.7062540054321 seconds.

EDIT2: New examples:

SELECT NOW(), NOW() + 1 SECOND;
SELECT NOW(), ADDTIME( NOW(), '0:00:01' );

And the time results:

Single interval:  8.4611599445343 seconds.
Addtime:          8.7186510562897 seconds.

Does the ADDTIME parsing always slow it down so much, that the difference can been seen pretty well?

  • 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-12T17:39:30+00:00Added an answer on June 12, 2026 at 5:39 pm

    The real question is if this is really a kind of performance gain you’re looking for. Running this 100K times shows a difference of 0.02 sec. So if you run it 5 million times you save one second.

    It’s not fair to compare the two since the interval has to do 3 calculations (hour/minute/second). This will slow it down.

    The ADDTIME() will have to parse the time which also slow it down.

    Then if you’re looking for performance use this:

     NOW() + INTERVAL 3661 SECOND
    

    But even then you’re saving milliseconds. If this is really the bottleneck of your application, then you’ve done a wonderful job :).

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

Sidebar

Related Questions

Here an example queries to get two type of icons.. $fetchIcon = array(); $queryIcon
I am doing two queries SELECT * FROM datedim WHERE year = YEAR(now()); and
So the example from the wiki has phantom.exit() in two places here. Why can't
Here's a contrived example: I want to divide two numbers and I need to
I have two tables, images and image_data and here is an example of my
Here are two queries that return the same resultset, but which is the optimal
I have this two queries: SELECT `a`.*, `b`.`id` AS host_id, SUM(CASE WHEN c.event_id IS
I am using a two LINQ queries(nested) Here's what I want my query to
Here's two screen shots, showing the effect with a small viewport that has to
Here is two variants. First: int n = 42; int* some_function(int* input) { int*

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.