Board index » delphi » Add index to TQuery result set??

Add index to TQuery result set??

Any body know if I can add an index to a TQuery result set??
How??

 

Re:Add index to TQuery result set??


Why do you need to have an index for it?  For sorting purposes?  

Re:Add index to TQuery result set??


Quote
glatzfa...@aol.com (Glatzfamly) wrote:
>Why do you need to have an index for it?  For sorting purposes?  

  I put a DBGrid for user to view selected records (From the TQuery)
  I want to let user to click on column heading to sort on different
column.  Issuing another SQL query to have another ORDER BY takes a
very long time.
  Any suggestion??

Re:Add index to TQuery result set??


The only suggestion I can figure out is using a table and the SQL
statement to INSERT the records of the result set into it.
This will require a little change of the SQL.

I already did this for one very data intensive form and now it works
much faster.

Quote
Anders LEE wrote:
> glatzfa...@aol.com (Glatzfamly) wrote:

> >Why do you need to have an index for it?  For sorting purposes?

>   I put a DBGrid for user to view selected records (From the TQuery)
>   I want to let user to click on column heading to sort on different
> column.  Issuing another SQL query to have another ORDER BY takes a
> very long time.
>   Any suggestion??

Other Threads