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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:25:32+00:00 2026-06-08T17:25:32+00:00

My mysql server has long_query_time = 2 configured but I still see these queries

  • 0

My mysql server has long_query_time = 2 configured but I still see these queries reported in slow query log that seem fast:

# Time: 120730  5:06:41
# User@Host: <user> @ <Host> [<IP>] 
# Query_time: 0.000412  Lock_time: 0.000060 Rows_sent: 5  Rows_examined: 5
SET timestamp=1343639201;
SELECT album_id FROM `TB_albums` where album_id!='res_4fe4333271bda7.42833845' and deleted is NULL order by `created_time` desc limit 5;

As you can see Query_time: 0.000412 Lock_time: 0.000060 seems way below 2 seconds

Do you have any Idea why these “fast” queries are reported?

  • 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-08T17:25:33+00:00Added an answer on June 8, 2026 at 5:25 pm

    MySQL also logs queries which do not use an index

    The option log-queries-not-using-indexes in my.cnf is used to control this. Mine is turned off (by commenting out) as you can see from this snippet of my.cnf

    # Here you can see queries with especially long duration
    log_slow_queries        = /var/log/mysql/mysql-slow.log
    long_query_time = 2
    #log-queries-not-using-indexes
    

    If you don’t have access to the my.cnf, you can check using SQL

    mysql> show variables like 'log_queries_not_using_indexes';
    +-------------------------------+-------+
    | Variable_name                 | Value |
    +-------------------------------+-------+
    | log_queries_not_using_indexes | OFF   |
    +-------------------------------+-------+
    1 row in set (0.00 sec)
    

    Hope that helps!

    Chris

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

Sidebar

Related Questions

I am running MySQL server on the server's which has following specifications - Dual
I am trying to connect to a MySQL server using PHP's 'mysql_connect()' function, but
I'm running SQL query for MySQL server with ... where name in (term1,term2,term3) I
I'm trying to migrate from sql server 2000 to mysql by using DTS. That's
My Sql Server database has some nullable nvarchar fields, and no nvarchar fields containing
I have a following scenario in my SQL Server 2005 database. zipcodes table has
I have successfully implemented a mysql server as a JDBCRealm for authentication in Tomcat
I am trying to connect to a MySQL Server using JDBC tool in java
When I try to start my MYSQL server on XAMPP and a Mac computer.
I need to install a MySql server on my Windows machine to run a

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.