Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE [dbo].[My_Transactions](
- [My_TransactionId] [bigint] NOT NULL,
- [FileId] [int] NOT NULL,
- [RowNo] [int] NOT NULL,
- [TransactionTypeId] [smallint] NOT NULL,
- [TransactionDate] [datetime] NOT NULL,
- [TransactionNumber] [dbo].[TransactionNumber] NOT NULL,
- [CardNumber] [dbo].[CardNumber] NULL,
- [AccountNumber] [dbo].[CardNumber] NULL,
- [BankCardTypeId] [smallint] NOT NULL,
- [AcqBankId] [smallint] NOT NULL,
- [DeviceNumber] [dbo].[DeviceNumber] NOT NULL,
- [Amount] [dbo].[Amount] NOT NULL,
- [DeviceTypeId] [smallint] NOT NULL,
- [TransactionFee] [dbo].[Amount] NOT NULL,
- [AcqSwitchId] [tinyint] NOT NULL
- ) ON [PRIMARY]
- GO
- CREATE NONCLUSTERED INDEX [_dta_index_Jam_Transactions_8_1290487676__K1_K4_K12_K6_K11_5] ON [dbo].[Jam_Transactions]
- (
- [Jam_TransactionId] ASC,
- [TransactionTypeId] ASC,
- [Amount] ASC,
- [TransactionNumber] ASC,
- [DeviceNumber] ASC
- )
- INCLUDE ( [TransactionDate]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- GO
- CREATE NONCLUSTERED INDEX [_dta_index_Jam_Transactions_8_1290487676__K12_K6_K11_K1_5] ON [dbo].[Jam_Transactions]
- (
- [Amount] ASC,
- [TransactionNumber] ASC,
- [DeviceNumber] ASC,
- [Jam_TransactionId] ASC
- )
- INCLUDE ( [TransactionDate]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- GO
- CREATE NONCLUSTERED INDEX [IX_Jam_Transactions] ON [dbo].[Jam_Transactions]
- (
- [Jam_TransactionId] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- GO
- UPDATE STATISTICS my_table
- A, B, D, E, F
- A, B, D, E, F, C
- A, B, D, _, E, F
- SELECT *
- FROM your_table_name WITH (INDEX(your_index_name))
- WHERE your_column_name = 5
Add Comment
Please, Sign In to add comment