简体   繁体   English

SQL Server System.OutOfMemoryException +太多结果

[英]SQL Server System.OutOfMemoryException + too many outcomes

I'm a self-learning SQL programmer. 我是一个自学的SQL程序员。

When I tried to join the tables (there are probably near to 100 mil outcome), a System.OutOfMemoryException is thrown. 当我尝试加入表时(结果可能接近1亿),将引发System.OutOfMemoryException My main purpose is to generate the combination of values; 我的主要目的是生成值的组合; the other table (which stored a set of other numbers) will take these values in every rows, compared with itself and devise the buy/sell strategy. 另一个表(存储了一组其他数字)将与自己进行比较,在每一行中采用这些值,并制定购买/出售策略。 This italic part is where the outofmemory error occurs. 斜体部分是发生内存不足错误的地方。 Thus you can imagine the dataset will be huge. 因此,您可以想象数据集将是巨大的。

This is the code: 这是代码:

select * 
into #MyTempTable 
from
    (Select distinct Parm_H 
     from [dbo].[Parmset1]) A1
inner join 
    (Select distinct Parm_D 
     from [dbo].[Parmset1]) A2 on A1.Parm_H > A2.Parm_D
inner join
    (Select distinct Parm_A 
     from [dbo].[Parmset1]) A3 on A2.Parm_D > A3.Parm_A


select * 
from [dbo].[MatchRegression]
cross join #MyTempTable

My computer spec is as below 我的电脑规格如下

  • i3-6100U i3-6100U
  • Ram: 8 GB 内存:8 GB
  • System type: 64 bit 系统类型:64位

My question is: 我的问题是:

  • While online resources said it is the RAM issue, does only add RAM without upgrading to I7 helps? 虽然在线资源说这是RAM问题,但是仅添加RAM而无需升级到I7会有所帮助吗?

  • Discussed with some experienced programmers, it is the code itself that matters as too many joins are involved- so changing RAM does not help. 与一些经验丰富的程序员讨论过的是,代码本身很重要,因为涉及到太多的联接,因此更改RAM毫无帮助。 Any ideas that I can achieve my main objective without going through much joinings. 任何不需要大量参与即可实现我的主要目标的想法。

  • Since I was using SQL Server, any other software would be specifically designed for handling huge set of data (Free of charge; more applicable use) and compatible to the current spec of my computer? 自从我使用SQL Server以来,是否会专门设计任何其他软件来处理大量数据(免费;更适用),并且与我的计算机的当前规格兼容?

I'm willing to learn anyway. 无论如何我都愿意学习。

Thanks, Vincent 谢谢文森特

The out of memory exception is generated by the 32 bit SSMS client that you are using. 内存不足异常是由您使用的32位SSMS客户端生成的。

select * from [dbo].[MatchRegression] cross join #MyTempTable

Obviously, you are not manually going to view the data and do anything with it, so my suggestion would be to insert this into another table and run queries on it , not trying to select all data to show in the datagrid or client application. 显然,您不会手动查看数据并对其进行任何处理,因此我的建议是将其插入到另一个表中并对它运行查询,而不是尝试选择要在datagrid或客户端应用程序中显示的所有数据。 SQL Server should easily be able to handle billions of rows of data without any problem. SQL Server应该可以轻松地处理数十亿行数据,而不会出现任何问题。

Though, you might need to look at the edition comparison sheet to look at what edition of SQL Server would be best for your application depending on size of data, requirements etc 但是,您可能需要查看版本比较表,以根据数据大小,要求等来查看哪种SQL Server版本最适合您的应用程序

暂无
暂无

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

相关问题 增加最大服务器内存以处理SQL Server上的System.OutOfMemoryException - Increasing max server memory to deal with System.OutOfMemoryException on SQL Server 打开Sql Server文件时出现System.OutOfMemoryException错误 - System.OutOfMemoryException error when I open the Sql Server file 如何在SQL Server 2014中解决System.OutOfMemoryException - How to solve System.OutOfMemoryException in SQL Server 2014 将SQL Server 2016升级到版本13.0.15700.28后,经常发生System.OutOfMemoryException - System.OutOfMemoryException occurs frequently after Upgrading SQL Server 2016 to version 13.0.15700.28 “System.OutOfMemoryException: 'Out of memory.'”从 SQL 服务器读取图像时 - "System.OutOfMemoryException: 'Out of memory.'" when reading image from SQL Server 尝试运行由SQL Server Management Studio生成的创建表脚本时出现System.OutOfMemoryException - System.OutOfMemoryException when trying to run a create table script generated by SQL Server Management studio 查询大型SQL表时出现System.OutOfMemoryException - System.OutOfMemoryException when querying large SQL table System.OutOfMemoryException:angularjs中抛出了类型'System.OutOfMemoryException'的异常 - System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown in angularjs 训练 ML.NET -- System.OutOfMemoryException - Training ML.NET -- System.OutOfMemoryException 使用localdb进行NUnit测试期间的System.OutOfMemoryException - System.OutOfMemoryException during NUnit tests with localdb
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM