Skip to content

Commit

Permalink
Simply EventOutbox indexing. (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
chullybun committed Oct 17, 2023
1 parent 9e517c3 commit 5aaa975
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Represents the **NuGet** versions.

## v2.3.12
- *Fixed:* The `OutBox.EventOutbox` table clustered/non-clustered indexes changed to simplify default implementation. Implementors of this capability should review the indexing, etc., based on usage to optimize.
- _Note:_ it is also expected that the _Outbox_ tables are regularly purged, i.e. dequeued events should be removed. This is the responsibility of the implementor to perform as required.

## v2.3.11
- *Enhancement:* `DataParser.ParseJsonAsync` added to support JSON data file parsing in addition to the existing YAML. Files (embedded resources) can be mixed and matched as required.
- *Enhancement:* `DataParser` supports specified schema of `*` to provide `DataConfig` that is applied to all tables in the YAML/JSON file.
Expand Down
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>2.3.11</Version>
<Version>2.3.12</Version>
<LangVersion>preview</LangVersion>
<Authors>Avanade</Authors>
<Company>Avanade</Company>
Expand Down
4 changes: 2 additions & 2 deletions src/DbEx.SqlServer/Templates/TableEventOutbox_sql.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ CREATE TABLE [{{OutboxSchema}}].[{{OutboxTable}}] (
*/

{{/unless}}
[{{OutboxTable}}Id] BIGINT IDENTITY (1, 1) NOT NULL PRIMARY KEY NONCLUSTERED ([{{OutboxTable}}Id] ASC),
[{{OutboxTable}}Id] BIGINT IDENTITY (1, 1) NOT NULL PRIMARY KEY,
[PartitionKey] NVARCHAR(127) NULL,
[Destination] NVARCHAR(127) NULL,
[EnqueuedDate] DATETIME2 NOT NULL,
[DequeuedDate] DATETIME2 NULL,
CONSTRAINT [IX_{{OutboxSchema}}_{{OutboxTable}}_DequeuedDate] UNIQUE CLUSTERED ([PartitionKey], [Destination], [DequeuedDate], [{{OutboxTable}}Id])
INDEX [IX_{{OutboxSchema}}_{{OutboxTable}}_DequeuedDate] ([DequeuedDate], [{{OutboxTable}}Id])
);
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ CREATE TABLE [Outbox].[EventOutbox] (
* This is automatically generated; any changes will be lost.
*/

[EventOutboxId] BIGINT IDENTITY (1, 1) NOT NULL PRIMARY KEY NONCLUSTERED ([EventOutboxId] ASC),
[EventOutboxId] BIGINT IDENTITY (1, 1) NOT NULL PRIMARY KEY,
[PartitionKey] NVARCHAR(127) NULL,
[Destination] NVARCHAR(127) NULL,
[EnqueuedDate] DATETIME2 NOT NULL,
[DequeuedDate] DATETIME2 NULL,
CONSTRAINT [IX_Outbox_EventOutbox_DequeuedDate] UNIQUE CLUSTERED ([PartitionKey], [Destination], [DequeuedDate], [EventOutboxId])
INDEX [IX_Outbox_EventOutbox_DequeuedDate] ([DequeuedDate], [EventOutboxId])
);

0 comments on commit 5aaa975

Please sign in to comment.