我有一个场景,其中有大量关于项目的状态数据.该项目的状态从分钟更新到分钟,并且在不久的将来将有大约50,000个项目.因此,在一个月内,将有大约2,232,000,000行数据.在获得旧数据之前,我必须在主表中保留至少3个月.
我必须计划根据特定项目(其ID)和数据范围(通常最多一个月的范围)实现快速查询 - 例如,从Table中选择A,B,C,其中ItemID = 3000,日期介于'2010-之间10-01'和'2010-10-31 23:59:59.999'
所以我的问题是如何设计一个分区结构来实现这一目标?
目前,我基于"项目的唯一标识符"(一个int)mod"分区数"进行分区,以便所有分区均匀分布.但它的缺点是在表上保留一个额外的列作为分区函数的分区列,因此,将行映射到其分区.所有这些都增加了一些额外的存储空间.此外,每个分区都映射到不同的文件组.
我有几个数字列,希望它们是正确的.这是一个有点人为的例子,展示了我的问题:
<Window x:Class="MyApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=PresentationFramework" xmlns:Windows="clr-namespace:System.Windows;assembly=PresentationFramework" xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework" Title="MyApp"
Width="Auto" Height="Auto" SizeToContent="WidthAndHeight" Loaded="Window_Loaded">
<Controls:DataGrid Name="MyDataGrid" IsReadOnly="True"
xmlns="http://schemas.microsoft.com/wpf/2008/toolkit" ItemsSource="{Data:Binding}" AutoGenerateColumns="True">
<Controls:DataGrid.Columns>
<!-- This is a product name and is left justified by default -->
<Controls:DataGridTextColumn Header="ProductName" Binding="{Data:Binding Path=ProductName}" />
<!-- The rest of the columns are numeric and I would like for them to be right justified -->
<Controls:DataGridTextColumn Header="ProductId1" Binding="{Data:Binding Path=ProductId1}" >
<Controls:DataGridTextColumn.ElementStyle>
<Windows:Style TargetType="Controls:TextBlock">
<Windows:Setter Property="HorizontalAlignment" Value="Right"/>
</Windows:Style>
</Controls:DataGridTextColumn.ElementStyle>
</Controls:DataGridTextColumn>
<Controls:DataGridTextColumn Header="ProductId2" Binding="{Data:Binding Path=ProductId2}" >
<Controls:DataGridTextColumn.ElementStyle>
<Windows:Style TargetType="Controls:TextBlock">
<Windows:Setter …Run Code Online (Sandbox Code Playgroud) 我正在寻找java.util包中的数据结构.我需要它来满足以下要求:
我希望找到一个可索引的跳过列表,但我没有.他们是否有任何符合我所述要求的数据结构?
假设我有一个在应用程序持续时间内存在的对象.我们称之为GlobalWorker.GlobalWorker具有其他对象可以订阅的事件,例如UserLoggedIn.现在想象一下,我有一个Silverlight页面或一个asp.net页面,它在构造时订阅了UserLoggedIn事件.
public SomePage()
{
GlobalWorker.Instance.UserLoggedIn += new EventHandler(OnUserLoggedIn);
}
private void OnLoggedIn(object sender, EventArgs e)
{
}
Run Code Online (Sandbox Code Playgroud)
是否存在此事件会阻止页面被垃圾回收?如果是这样,在这个实例中使用的最佳模式是什么:弱事件处理程序,将订阅移动到Load事件并取消订阅UnLoad事件?
有3个是在线程调度的实现通常由操作系统内核进行使用的线程模型.其中之一是hybrid(M:N)模型,其中一些N应用程序线程映射到M内核线程,以便它们可以使用最多的M 处理器.这种模式有利有弊.其中一个优点是基于此模型的语言将引入语言级调度程序实现,该实现负责管理和调度应用程序级线程.
我不小心克隆了Subversion存储库而没有添加--stdlayout参数,给了我类似的东西:
$ git svn clone --prefix=svn/ svn+ssh://code.example.com/project
[two weeks later]
$ git branch -a
* master
remotes/svn/git-svn
Run Code Online (Sandbox Code Playgroud)
使用svn/git-svn布局是这样的:
branches/*
tags/*
trunk/*
Run Code Online (Sandbox Code Playgroud)
有什么方法可以从中恢复?
我想用up,down,left,right作为opengl + glut应用程序控件的一部分.我如何参考我的' keyboard'函数中的键(我传递给的那个glutKeyboardFunc)?
我知道之前曾问过这类问题,但其他方法现在都让我失望了.
正如我们的Windows服务轮询AD,给定一个LDAP(即LDAP://10.32.16.80)和该AD服务器中要搜索的用户组列表.它检索这些给定组中的所有用户,以递归方式搜索这些组以获取更多组.然后将每个用户添加到另一个应用程序认证用户列表中.
这部分应用程序运行成功.但是,我们需要每个用户的友好域名(即他们登录DOMAIN /用户名的一部分)
因此,如果有一个用户属于TEST域,名为Steve:TEST/steve就是他的登录名.我能够在广告中找到史蒂夫,但是我还需要将"TEST"与他的AD信息一起存储.
再一次,通过使用目录搜索器和我给出的LDAP IP,我可以找到'史蒂夫',但是考虑到LDAP IP,我如何才能找到友好的域名?
当我尝试以下代码时,我在尝试访问'defaultNamingContext'时遇到错误:
System.Runtime.InteropServices.COMException(0x8007202A):身份验证机制未知.
这是代码:
private string SetCurrentDomain(string server)
{
string result = string.Empty;
try
{
logger.Debug("'SetCurrentDomain'; Instantiating rootDSE LDAP");
DirectoryEntry ldapRoot = new DirectoryEntry(server + "/rootDSE", username, password);
logger.Debug("'SetCurrentDomain'; Successfully instantiated rootDSE LDAP");
logger.Debug("Attempting to retrieve 'defaultNamingContext'...");
string domain = (string)ldapRoot.Properties["defaultNamingContext"][0]; //THIS IS WHERE I HIT THE COMEXCEPTION
logger.Debug("Retrieved 'defaultNamingContext': " + domain);
if (!domain.IsEmpty())
{
logger.Debug("'SetCurrentDomain'; Instantiating partitions/configuration LDAP entry");
DirectoryEntry parts = new DirectoryEntry(server + "/CN=Partitions,CN=Configuration," + domain, username, password);
logger.Debug("'SetCurrentDomain'; …Run Code Online (Sandbox Code Playgroud) 我的PHP中的爆炸功能有问题.
我从数据库中提取字符串如下:
column_name
0,2000,0,3000,1000,7000,1000,0,0,0
Run Code Online (Sandbox Code Playgroud)
将它拉入一个名为$ recordset的对象后,我正在使用explode函数从中创建一个数组......如下所示:
$array = explode(",",$recordset->column_name)
Run Code Online (Sandbox Code Playgroud)
但是有些怎么样,阵列并不像我期望的那样......
这是我回应数组时得到的结果:
Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 3000
[4] => 7000
[5] => 2000
[6] => 1000
[7] => 1000
[8] => 0
[9] => 0
)
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,我没有得到我想要的值...但是,如果我的数据库中的字符串很短,请说:
1000,0,1200,0
Run Code Online (Sandbox Code Playgroud)
以上逻辑工作正常..
我不知道如何调试或解决这个问题..
请帮忙?
c# ×3
mysql ×2
c#-4.0 ×1
collections ×1
comexception ×1
dns ×1
git ×1
git-svn ×1
glut ×1
group-concat ×1
java ×1
multicore ×1
opengl ×1
php ×1
sortedlist ×1
sql-order-by ×1
sql-server ×1
wpf ×1
wpfdatagrid ×1