Re: Text column in select query

Tech-Archive recommends: Fix windows errors by optimizing your registry



Rogers,

You don't mention what you are ordering by (and perhaps also grouping by),
but assuming that the text column is not included in the ORDER BY or GROUP
BY clauses:

SELECT TOP 10 ID, colA, colB, colC
INTO #temp
FROM MyTable
ORDER BY colC, colB, colA

SELECT t.colA, t.colB, t.colC, m.textcolumn
FROM #temp t JOIN MyTable m
ON t.ID = m.ID
ORDER BY colC, colB, colA

This simply gets the text column out of the TOP 10, but returns it from the
second select.

RLF
"Rogers" <naissani@xxxxxxxxxxx> wrote in message
news:OOaI$Z8bHHA.4716@xxxxxxxxxxxxxxxxxxxxxxx
I have a text column table and that contains 3000 records but when I try to
use top 10 query and include text column it take 10 minutes and when I
remove the text column from the select query it takes a second, any idea
how we can speed up the query if I include text column in my list.



.



Relevant Pages

  • Re: Optimizer Issues with 10.00.xC8
    ... query runs), but the point is that in IDS 10.00.FC6, these queries ran ...  one is a composite, unique index on colA, colB ... and the other is a nonunique index on colC ...  If I run full statistics with distributions ...
    (comp.databases.informix)
  • Re: PHP/MySQL - Splitting similar data to two tables and querying as a whole
    ... > data - previous years stuff, which is only used in queries <5% of the ... select colA, colB, colC ...
    (comp.lang.php)
  • Re: id record for each table
    ... row ordering the rows by colA, colB descending, colC, where (colA, colB, ... No identity field but just a internal flag or hide field which computes each record. ...
    (microsoft.public.sqlserver.programming)
  • Re: Query Error
    ... INSERT INTO (colA, colB, colC) ... but I am getting an error message: runtime error 3134: SYNTAX ERROR IN INSERT INTO statement. ...
    (microsoft.public.access.queries)
  • Re: converting from long to double
    ... decimals). ... Append query - like this (say colC is the converting column): ... SELECT colA, colB, Val ...
    (comp.databases.ms-access)