简体   繁体   English

经典ASP:从SQL表转换页面文本,更快的方法吗?

[英]Classic ASP: Page text translated from SQL table, a faster way?

Using classic ASP VBScript, coupled to MS SQL Server, we have a function that takes 3 integers, page_id , heading_id , language_id 使用经典的ASP VBScript,再加上MS SQL Server,我们有一个函数,它接受3个整数, page_idheading_idlanguage_id

it looks up the page heading in a translation table... 它在翻译表中查找页面标题...

This table contains roughly 10,000 rows... 该表包含大约10,000行...

The heading column is nvarchar(1000) plus the 3 int columns meaning it's around 2KiB per row max... 标题列为nvarchar(1000)加上3个int列,这意味着每行最大值约为2KiB ...

so my question is, is it worth copying this table into memory (Application object for example) using ADO's GetRows or through another method, or is it not worth it due to the "large" data size. 所以我的问题是,是否值得使用ADO的GetRows或通过其他方法将此表复制到内存(例如Application对象)中,还是由于“大”数据大小而不值得?

There are approximately 1 to 250 headings per page, 462 pages, with average of 34 headings/page. 每页大约1至250个标题,即462页,平均每页34个标题。

So to save ~34 database calls a page, I use a large chunk of memory, and calls to application, and possibly it's slower anyway? 因此,要保存约34个数据库调用页面,我会使用大量内存,并调用应用程序,反正它可能会更慢?

Thoughts? 有什么想法吗?

Probably, save the calls. 大概保存通话。

Also, 34 database calls don't have to be 34 round trips. 同样,34次数据库调用不必是34次往返。 Batch your database calls. 批处理数据库调用。

For most data driven applications, the part that is usually most expensive is the database connection. 对于大多数数据驱动的应用程序,通常最昂贵的部分是数据库连接。 At 2k per row and 10k rows, that's still only 20 meg. 每行2k和10k行,仍然只有20兆。 If the data is used very frequently than that seems like a very small price to pay to eliminate unnecessary database hits. 如果数据被非常频繁地使用,那么消除不必要的数据库命中似乎要付出很小的代价。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM