I'm working on a search query, and I like the results it pulls but I dislike how much time it takes to run - so I've been attempting to narrow down where the slowdown is.
If you guys really need to see the query, I can post it - but I'd like to try doing it without it first.
The part of the query that actually does the searching (a subquery table) returns 1167 rows in less than a second (returning a productid and a RANK).
I've joined this result with our product table adding the productid field from that table (an integer) to the results - this also adds filtering of hidden products and categories. The 192 rows are returned in about 1 second.
So I start slowly adding fields (from tables already in the query so no new joins or anything).
mfgpartno - no speed change
productname - it now takes 1:20 for those 192 rows
productname is a varchar(500) field.
Any ideas why just adding a column from a table already in the query would add so much time to it?
Thanks.
If you guys really need to see the query, I can post it - but I'd like to try doing it without it first.
The part of the query that actually does the searching (a subquery table) returns 1167 rows in less than a second (returning a productid and a RANK).
I've joined this result with our product table adding the productid field from that table (an integer) to the results - this also adds filtering of hidden products and categories. The 192 rows are returned in about 1 second.
So I start slowly adding fields (from tables already in the query so no new joins or anything).
mfgpartno - no speed change
productname - it now takes 1:20 for those 192 rows
productname is a varchar(500) field.
Any ideas why just adding a column from a table already in the query would add so much time to it?
Thanks.