SELECT lento en una tabla de 9000 filas

  • Hola, tengo el sgte inconveniente con una tabla de 9000 filas, la cual en teoria no es una tabla grande, cuando se realiza un SELECT de esta tabla demora mucho.

    Tiene un indice PRIMARY KEY CLUSTERED de tipo entero autoincremental.

    Mi duda es por que demora mucho si no es una tabla con muchos registros.

  • Most people on this forum speak English. If you can translate your question, you will probably get a better response.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • sistemas_casinomnes (9/30/2014)


    Hola, tengo el sgte inconveniente con una tabla de 9000 filas, la cual en teoria no es una tabla grande, cuando se realiza un SELECT de esta tabla demora mucho.

    Tiene un indice PRIMARY KEY CLUSTERED de tipo entero autoincremental.

    Mi duda es por que demora mucho si no es una tabla con muchos registros.

    [Rough translation from Google]

    Hi, I have the drawback sgte with a table of 9000 rows, which in theory is not a large table, when a SELECT from this table takes much is done.

    It has a PRIMARY KEY CLUSTERED index of auto-increment integer.

    My question is why it takes a lot if there is a table with many records.

    9000 rows is not a large table by any definition. In general, your query should come back very quickly. If it is slow, there are many things that could be causing it.

    You would need to post DDL for the table, some test data, your query and the execution plan from your slow query to even begin to start to guess at the cause of the slowness.

    __________________________________________________________________________________________________________
    How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Please post full table DDL, the SELECT statement that's running slowly, and the actual execution plan for the query.

    John

  • It looks like John beat me to it, if you can post a query plan that would be a great help - see: How to Post Performance Problems[/url]

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • My translation:

    Hi, I have the following inconvenient with a table with 9000 rows, which in theory is not a big table. When a SELECT is run on this table is taking too long.

    It has a PRIMARY KEY CLUSTERED index which is an auto-increment integer.

    My question is why does it take so long if it's not a table with many rows.

    (English below)

    Como mencionan los demás, necesitamos más detalles ¿Cómo estás consultando la tabla? Necesitamos ver la estructura de la tabla (se pueden cambiar los nombres de los campos) y el SELECT que estás usando. Hay muchas cosas que pueden ser, desde bloqueos hasta memoria del cliente. Por favor, define a que te refieres con demasiado tiempo.

    (English)

    As everyone else mentioned, we need more details. How are you querying the table? We need to see the structure of the table (column names can be different to the real ones) and the SELECT statement that you're using. There are many reasons that can go from blocking to memory available in the client. Please, define what you mean when you say too long.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply