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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:01:43+00:00 2026-06-03T20:01:43+00:00

I run a simple SELECT (noted below) in a stored procedure of a table

  • 0

I run a simple SELECT (noted below) in a stored procedure of a table that’s around 1,500 rows.

CREATE PROCEDURE `LoadCollectionItemProperty`(IN sId int(10))
BEGIN
SELECT *
FROM itemproperty
WHERE itemid IN
    (SELECT itemid
    FROM collectionitem
    WHERE collectionid = sId AND removed ='0000-00-00 00:00:00');
END 

This operation takes around 7 seconds. I inserted Breakpoints and used F11 to determine that upon MySqlAdapter.Fill is where the lag starts. Both my computer and the server hosting the MySQL database are NOT challenged spec wise. I’m guessing it’s the query itself.

collectionitem holds the 2 foreign keys linking an itemproperty to a collection. we feed the sproc sId(PK of collection) so that the subquery returns all the itemids from a specific collection and then we use the itemid(PK) in itemproperty.

Is there any way to speed up the process?

UPDATE

My issue was entirely due to improper indexing. Once I learned which columns to index, everything is extremely smooth! Thank you for your help.

  • 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-03T20:01:44+00:00Added an answer on June 3, 2026 at 8:01 pm

    You can try this, but it may not help much if your tables are missing indexes.

    BEGIN
    SELECT *
    FROM itemproperty i
    WHERE exists
        (SELECT 1
        FROM collectionitem c
        WHERE collectionid = sId AND i.itemid = c.itemid AND removed ='0000-00-00 00:00:00');
    END 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have the following simple Stored Procedure that runs as an overnight SQL server
I am not able to run a simple select query with a where clause.
I am trying to run a simple FQL query: SELECT aid,name FROM album WHERE
I am getting a warning message when I run even a simple select query
I want to run a simple JavaScript function on a click without any redirection.
I can't run an simple XNA window in fullscreen when I have hooked up
When I run this simple code: from pylab import * import numpy as np
I am trying to run a simple multiple processes application in Python. The main
I am trying to run a simple SQLITE application on Windows Mobile developed with
I'm trying to run a simple query with $this->db in Kohana, but am running

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.