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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:15:31+00:00 2026-06-05T23:15:31+00:00

The queries are as simple as that: Eg 1: UPDATE threads SET hits =

  • 0

The queries are as simple as that:

Eg 1: "UPDATE threads SET hits = hits+1 WHERE id = TID"
Eg 2: "UPDATE users SET last_activity = unix_timestamp() WHERE id = UID"

`users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `last_activity` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

`threads` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `hits` int(10) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

Let’s take this query as example:

mysql_query("UPDATE users SET last_activity = unix_timestamp() WHERE id = UID");

without the query, script takes ~30 ms to execute:

enter image description here

with the query, script takes ~110 ms to execute:

enter image description here

Best regards, Duluman Edi

LE: The code that generates the execution time is the following:

///this is placed above any code
$mtime = explode(' ',microtime()); 
$mtime = $mtime[1] + $mtime[0]; 
$tstart = $mtime;
.....
my game code is here
.....
$mtime = explode(' ',microtime());
echo lang('info','page_load').' '.number_format(($mtime[1] + $mtime[0]) -    $tstart,4,'.','')*1000; 

This is how I calculate the execution time, and it’s pretty accurate, never failed me.
P.S. – The real execution time is about 15 ms lower, because I’m hosting this on Windows at the moment.

  • 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-05T23:15:32+00:00Added an answer on June 5, 2026 at 11:15 pm

    I guess I could make an ajax call on $(document).ready() to make this changes after page loads, because this UPDATE statement is quite nested up.

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

Sidebar

Related Questions

I'm working on code that does nearest-neighbor queries. There are two simple ideas that
That seems simple enough, but all Django Queries seems to be 'SELECT *' How
I wrote a simple tool to generate a DBUnit XML dataset using queries that
I am using JPA/Hibernate to call simple CRUD queries (create, update, findByXAndYAndZ...). However, as
I have several sql queries that I simply want to fire at the database.
For some short and simple queries I've been using the query designer in SSMS
I'm new to linq and having trouble writing two simple queries. For some reason,
I have created some documents and managed to make some simple queries but I
Most of the DAO examples I've seen consist of simple queries only involving one
I was wondering if there are any performance differences when using simple queries as:

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.