服务器端 SQL 库 [英] server-side SQL library
问题描述
.net 中是否存在可以在服务器端执行查询的库?
我问的原因是尽管我使用了许多技巧来最大化数据库性能,例如 SELECT
ing 和 JOIN
ing 在 PRIMARY
上>,使用INT
作为PRIMARY
,固定LENGTH
s,UPDATE
代替DELETE
ing,没有 NULL
s 列被 UPDATE
d 和 UPDATE
ing 表使用 INT
> 状态"列(例如活动"、非活动"等),但延迟时间从 <10 毫秒到 >100 毫秒,只需使用几个 SELECT
和 1 个 JOIN
每个都使用上述技术.
我将开始使用服务器来JOIN
,因为我已经成功地将延迟降低了 <10 毫秒,但我想知道是否已经有可以执行此操作的库或内置功能.</p>
一个例子是将单个 JOIN
查询分解为多个查询:
SELECT
基于PRIMARY
键的table1
中的特定行SELECT
基于table1
中的
PRIMARY
来自 table2
的特定行而且复杂性只会从那里增加..net 是否存在这样的库/功能?
非常感谢!
听起来您正在寻找类似于 ADO.NET 实体框架.使用 LINQ,您可以通过以下方式查询代码中的数据:将查询表达式转换为 SQL 并进行优化(尽可能优化)以获取您要查询的数据.
Does a library exist in .net that can perform queries server-side?
The reason I ask is even though I've used many tricks to maximize database performance such as SELECT
ing and JOIN
ing on the PRIMARY
, using INT
s as the PRIMARY
, fixed LENGTH
s, UPDATE
ing instead of DELETE
ing, no NULL
s for columns to be UPDATE
d, and UPDATE
ing tables by using an INT
"state" column (such as "active", "inactive", etc), but latency times go from <10ms to >100ms just by using a few SELECT
s with 1 JOIN
each using the techniques above.
I'm going to start using the server to JOIN
instead because I've had lots of success with driving lag back down <10ms doing so, but I'm wondering if there's already a library or built-in feature that can do this.
An example would be breaking a single JOIN
query into multiple queries:
SELECT
a specific row from atable1
based upon thePRIMARY
keySELECT
a specif row fromtable2
based upon thePRIMARY
located intable1
And the complexity only increases from there. Does such a library/feature exist for .net?
Many thanks in advance!
It sounds like you're looking for something like the ADO.NET Entity Framework. Using LINQ, you can query data in code in such a way that the query expressions are converted to SQL and optimized (as best as possible) to get the data you're querying.
这篇关于服务器端 SQL 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!