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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:04:47+00:00 2026-06-08T05:04:47+00:00

I have a table in my database : And I’m using MySQL to insert/update/create

  • 0

I have a table in my database :

enter image description here

And I’m using MySQL to insert/update/create info however the time it takes to execute queries is slow example:

First when a user runs my app it verifies they can use it by retrieving all IPs from the db with

SELECT IP FROM user_info

Then using a while loop if the IP is in the db do another query:

"SELECT Valid FROM user_info WHERE IP='".$_SERVER['REMOTE_ADDR']."'""

If Valid is 1 then they can use it otherwise they can’t however if their IP is not found in the db it creates a new entry for them using

"INSERT INTO user_info (IP,First) VALUES ('".$_SERVER['REMOTE_ADDR']."','".date("Y/m/d") ."')")"

Now this first script has finished it accesses another – this one was supposed to update the db every minute however i don’t think i can accomplish that now ; the update query is this:

"UPDATE user_info SET Name='".$Name."', Status='".$Status."', Last='".$Last."', Address='".$Address."' WHERE IP='".$_SERVER['REMOTE_ADDR']."'")"

All together it takes average 2.2 seconds and there’s only 1 row in the table atm

My question is how do i speed up mysql queries? I’ve read about indexes and how they can help improve performance but i do not fully understand how to use them. Any light shed on this topic would help.

Nubcake

  • 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-08T05:04:49+00:00Added an answer on June 8, 2026 at 5:04 am

    Indexes will become very important as your site grows, but they won’t help when you have only one row in your table and it cannot be the reason why your queries take so long. You seem to have some sort of fundamental problem with your database. Maybe it’s a latency issue.

    Try starting with some simpler queries like SELECT * FROM users LIMIT 1 or even just SELECT 1 and see if you still get bad performance.

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

Sidebar

Related Questions

My database table have a Timestamp column and i am using LINQ for insert,
My database table have a Timestamp column named as inTime and i am using
I have a database table with some rows that I want to fetch using
I have a database table named Categories . I want to create a form
If i have this table on dataBase.js file: client.query( 'CREATE TEMPORARY TABLE IF NOT
I have Database table and I am using SQL Server 2008. The table contins
I have table in MySQL database with two integer columns for example: userid |
I have a MYSQL database table called 'wp_quotes' with a field that contains a
I have this homework question: Assume a Database table has 0 records at time
I have database table: DROP TABLE translation_en_lt; CREATE TABLE translation_en_lt ( id INTEGER, lt_translation

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.