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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:54:44+00:00 2026-05-11T17:54:44+00:00

We have a lot of queries select * from tbl_message that get stuck on

  • 0

We have a lot of queries

select * from tbl_message

that get stuck on the state “Writing to net”. The table has 98k rows.

The thing is… we aren’t even executing any query like that from our application, so I guess the question is:

  • What might be generating the query?
  • …and why does it get stuck on the state “writing to net”

I feel stupid asking this question, but I’m 99,99% sure that our application is not executing a query like that to our database… we are however executing a couple of querys to that table using WHERE statement:

 SELECT Count(*) as StrCount FROM tbl_message WHERE m_to=1960412 AND m_restid=948

 SELECT Count(m_id) AS NrUnreadMail FROM tbl_message WHERE m_to=2019422 AND m_restid=440 AND m_read=1

 SELECT * FROM tbl_message WHERE m_to=2036390 AND m_restid=994 ORDER BY m_id DESC

I have searched our application several times for select * from tbl_message but haven’t found anything… But still our query-log on our mysql server is full of Select * from tbl_message queries

  • 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-11T17:54:44+00:00Added an answer on May 11, 2026 at 5:54 pm

    Since applications don’t magically generate queries as they like, I think that it’s rather likely that there’s a misstake somewhere in your application that’s causing this. Here’s a few suggestions that you can use to track it down. I’m guessing that your using PHP, since your using MySQL, so I’ll use that for my examples.

    Try adding comments in front of all your queries in the application, like this:

    $sqlSelect  = "/* file.php, class::method() */";
    $sqlSelect .= "SELECT * FROM foo ";
    $sqlSelect .= "WHERE criteria";
    

    The comment will show up in your query log. If you’re using some kind database api wrapper, you could potentially add these messages automatically:

    function query($sql)
    {
        $backtrace = debug_backtrace();
        // The function that executed the query
        $prev = $backtrace[1];
        $newSql = sprintf("/* %s */ ", $prev["function"]);
        $newSql .= $sql;
    
        mysql_query($newSql) or handle_error();
    }
    

    In case you’re not using a wrapper, but rather executing the queries directly, you could use the runkit extension and the function runkit_function_rename to rename mysql_query (or whatever you’re using) and intercept the queries.

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

Sidebar

Related Questions

I have a lot of SQL queries like this: SELECT o.Id, o.attrib1, o.attrib2 FROM
I have a table I'm working on that has around 3 million tuples. It
Below is my table and some queries I run that take a lot of
I have already finished writing a lot of queries in hibernate for my project.
I have mysql table tmp with columns pid,city,state,country. I write queries so i can
I currently have a closure table used for hierarchical data that has 5 million
I have a C# console application that makes a bunch of queries to a
We have a lot of queries for which we append a random alias at
I have compared two queries which fetch some fairly large data from a database
I am running Blogengine.Net and have noticed that the tables are all created lower

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.