Skip to content

Commit

Permalink
针对Mysql启用压缩表
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jan 6, 2025
1 parent bc8cfd7 commit ff202a9
Show file tree
Hide file tree
Showing 13 changed files with 310 additions and 285 deletions.
2 changes: 1 addition & 1 deletion Plugins/MySqlAgent/MySqlAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NewLife.XCode" Version="11.17.2025.101" />
<PackageReference Include="NewLife.XCode" Version="11.17.2025.103-beta1504" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 5 additions & 1 deletion Stardust.Data/Entity/应用历史.Biz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using NewLife.Data;
using NewLife.Log;
using XCode;
using XCode.Membership;

namespace Stardust.Data;

Expand All @@ -23,6 +22,11 @@ static AppHistory()
Meta.Modules.Add<UserModule>();
Meta.Modules.Add<TimeModule>();
Meta.Modules.Add<IPModule>();

// 针对Mysql启用压缩表
var table = Meta.Table.DataTable;
table.Properties["ROW_FORMAT"] = "COMPRESSED";
table.Properties["KEY_BLOCK_SIZE"] = "4";
}

/// <summary>验证并修补数据,通过抛出异常的方式提示验证失败。</summary>
Expand Down
5 changes: 5 additions & 0 deletions Stardust.Data/Entity/应用性能.Biz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ static AppMeter()
// 过滤器 UserModule、TimeModule、IPModule
Meta.Modules.Add<TimeModule>();
Meta.Modules.Add<IPModule>();

// 针对Mysql启用压缩表
var table = Meta.Table.DataTable;
table.Properties["ROW_FORMAT"] = "COMPRESSED";
table.Properties["KEY_BLOCK_SIZE"] = "4";
}

/// <summary>验证并修补数据,通过抛出异常的方式提示验证失败。</summary>
Expand Down
5 changes: 5 additions & 0 deletions Stardust.Data/Monitors/跟踪数据.Biz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ static TraceData()

// 过滤器 UserModule、TimeModule、IPModule
Meta.Modules.Add<TimeModule>();

// 针对Mysql启用压缩表
var table = Meta.Table.DataTable;
table.Properties["ROW_FORMAT"] = "COMPRESSED";
table.Properties["KEY_BLOCK_SIZE"] = "4";
}

/// <summary>验证数据,通过抛出异常的方式提示验证失败。</summary>
Expand Down
2 changes: 1 addition & 1 deletion Stardust.Data/Monitors/跟踪数据.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public partial class TraceData
[DisplayName("编号")]
[Description("编号")]
[DataObjectField(true, false, false, 0)]
[BindColumn("Id", "编号", "", DataScale = "timeShard:yyyyMMdd")]
[BindColumn("Id", "编号", "", DataScale = "timeShard:dd")]
public Int64 Id { get => _Id; set { if (OnPropertyChanging("Id", value)) { _Id = value; OnPropertyChanged("Id"); } } }

private DateTime _StatDate;
Expand Down
6 changes: 5 additions & 1 deletion Stardust.Data/Monitors/采样数据.Biz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Xml.Linq;
using System.Xml.Serialization;
using NewLife;
using NewLife.Data;
Expand Down Expand Up @@ -33,6 +32,11 @@ static SampleData()

// 过滤器 UserModule、TimeModule、IPModule
Meta.Modules.Add<TimeModule>();

// 针对Mysql启用压缩表
var table = Meta.Table.DataTable;
table.Properties["ROW_FORMAT"] = "COMPRESSED";
table.Properties["KEY_BLOCK_SIZE"] = "4";
}

/// <summary>验证数据,通过抛出异常的方式提示验证失败。</summary>
Expand Down
2 changes: 1 addition & 1 deletion Stardust.Data/Monitors/采样数据.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public partial class SampleData
[DisplayName("编号")]
[Description("编号")]
[DataObjectField(true, false, false, 0)]
[BindColumn("Id", "编号", "", DataScale = "timeShard:yyyyMMdd")]
[BindColumn("Id", "编号", "", DataScale = "timeShard:dd")]
public Int64 Id { get => _Id; set { if (OnPropertyChanging("Id", value)) { _Id = value; OnPropertyChanged("Id"); } } }

private Int64 _DataId;
Expand Down
Loading

0 comments on commit ff202a9

Please sign in to comment.