It is worth considering the possibility of using a clustered columnstore index on a table since it provides a high data compression ratio.
For example:
Create Table [dbo].[Tbl] (ID Int Identity(1,1), Txt nVarChar(max))
Declare @Cnt Int = 0
Declare @LowerNum Int = 500
Declare @UpperNum Int = 8000
Declare @Length Int
-- filling in the table with data
While @Cnt < 20000
Begin
Select @Length = Round(((@UpperNum - @LowerNum) * Rand()) + @LowerNum, 0)
Insert Into [dbo].[Tbl] (Txt)
Select Txt
From OpenJson((Select Txt From (Select crypt_gen_random(@Length) As Txt) As R For Json Auto)) With (Txt nVarChar(max))
Set @Cnt = @Cnt + 1
End
Сreating a clustered primary key on the [ID] column.
ALTER TABLE [dbo].[Tbl] ADD CONSTRAINT [PK_Tbl] PRIMARY KEY CLUSTERED
(
[ID] ASC
) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF,
IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON,
FILLFACTOR = 90, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF)
ON [PRIMARY]
The size of the table in this case is about 250MB.
Let's create a clustered columnstore index instead of a clustered primary key.
CREATE CLUSTERED COLUMNSTORE INDEX [PK_Tbl] ON [dbo].[Tbl] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
Now the size of the table is about 135MB.