Hi,
I'm working with an SQL Server over VPN (latency > 100ms) and we have a lot of stored procedures (unfortunately, been working on refactoring those). When I press CTRL-SPACE to get a table lookup while writing a SQL query, Heidi starts querying help texts for all of those stored procedures. With 200 stored procedures at 100 ms wait, it takes about 20 seconds before I can continue working.
You could theoretically send all of those exec sp_helptext in one query and receive a large number of result sets, I suppose. Just tested it for 298 exec's in one query, and while it took HeidiSQL a little while to paint all those result sets, the actual query took only 1.079 seconds.
Regards
Matt
exec sp_helptext takes a long time
Code modification/commit
0f2931b
from ansgarbecker,
9 years ago,
revision 9.3.0.4990
Introduce query caching in TDBConnection.PrefetchResults() and PrefetchCreateCode(). Read from that cache in TDBConnection.GetResults. This way we can prefetch mass queries fired for each object in a database, like in GetCreateCode() in one single batch query. See http://www.heidisql.com/forum.php?t=19350
I just introduced some sort of query caching, deeply in HeidiSQL's connection code. This is highly experimental, and we should test it thoroughly before the next official release. Just update to the latest build, which is r4990.
This query caching is yet only used in the case you described - when the completion proposal pops up and fires certain queries for each routine in a database. This is done in MSSQL for the EXEC sp_helptext query, and in MySQL for SHOW CREATE FUNCTION/PROCEDURE queries. Not more yet, but I'm open for other use cases here.
This query caching is yet only used in the case you described - when the completion proposal pops up and fires certain queries for each routine in a database. This is done in MSSQL for the EXEC sp_helptext query, and in MySQL for SHOW CREATE FUNCTION/PROCEDURE queries. Not more yet, but I'm open for other use cases here.
I've just tested it briefly on a couple of databases and it seems to work, as far as I can see.
However - it highlights another issue with HeidiSQLStored procedures are part of a schema, "dbo" being the normal of course. But when HeidiSQL lists stored procedures in the schema "Maintenance", which is part of our database, the schema disappears. As a result, if the SP is named 'CleanUp', it tries to run the query
EXEC sp_helptext '.CleanUp'
where it actually should have run
EXEC sp_helptext 'Maintenance.CleanUp'
All the dbo SP's work fine, though.
However - it highlights another issue with HeidiSQLStored procedures are part of a schema, "dbo" being the normal of course. But when HeidiSQL lists stored procedures in the schema "Maintenance", which is part of our database, the schema disappears. As a result, if the SP is named 'CleanUp', it tries to run the query
EXEC sp_helptext '.CleanUp'
where it actually should have run
EXEC sp_helptext 'Maintenance.CleanUp'
All the dbo SP's work fine, though.
Code modification/commit
7f02ee7
from ansgarbecker,
9 years ago,
revision 9.3.0.4991
Use db.func instead of schema.func when schema is empty, on retrieving MSSQL routine structure. See http://www.heidisql.com/forum.php?t=19350#p19360
Please login to leave a reply, or register at first.