|
Hi All, We have a MySQL db with a query which looks up data through joins from huge tables (more than 6 million records). I get disctinct counts or do substring_index() multiple times to parse a column string and retrieve the required text. then I use this data to populate flash based fusion charts in a grails-groovy application. Right now the complex graphs are getting timed out, simple ones which access smaller tables load properly, so How do I Improve query performance for the complex graph. We are trying to parse the data before storing it into the table so we dont need to do substring_index on columns, and we are having indexes on the primary keys and that long string column. Here is one sample query for a graph:
(comments are locked)
|
|
You mention that you have an index on the long string column, do you mean the TRANSACTIONTEXT column? In that case, it's not used anyway because of your LIKE '%<-->%' search. When you use the % wildcard in the beginning of your search string the condition is not searchable and a scan is used instead. I am using SQL server and from my point of view I would look at the following:
(comments are locked)
|


This forum is about SQL server and Oracle, but maybe you'll get some help anyway.