Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:37:57+00:00 2026-06-04T11:37:57+00:00

I have a table with zero rows now but will grow to 4-5 million

  • 0

I have a table with zero rows now but will grow to 4-5 million in a year.
biglogid is using a “COMB GUID” to keep the table/index from fragmenting.
When rows are added, rowstate will have a value of 1. However, when the rows are not needed, they will be set to null (nothing can be deleted except by yearly cleanup, business rule). Since this means that there will eventually be more null than non-null columns, rowstate column is made Sparse.

A select from the table wold be “select logtext from biglog where biglogid=…… and rowstate is not null” to only get a value if it is active. If that is the only real query run against the table, is there value in making the PK a filtered index? And if so, what is the TSQL syntax for that?

Thanks.

CREATE TABLE biglog(
    biglogid [uniqueidentifier] NOT NULL,
    logtext [varchar](400) NOT NULL,
    rowstate [tinyint] SPARSE  NULL,
 CONSTRAINT biglogpk PRIMARY KEY CLUSTERED 
(
    biglogid ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 85) ON [PRIMARY]
) ON [PRIMARY]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:37:59+00:00Added an answer on June 4, 2026 at 11:37 am

    You can’t define filtered index on PK. Is the following index useful for you?

    CREATE NONCLUSTERED INDEX MyIndex
        ON biglog(logtext)
        WHERE rowstate IS NOT NULL ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider I have a table with notes which could be associated with zero or
I have a html table with 3 rows and 1 column. In the top
I have a database table with a large number of rows and one numeric
I have a table of rows holding four different fields of numbers: people, debris,
What I have are two tables: mark_notifications mark_notifications_options The mark_notifications table contains rows of
I have a table that has some rows in it. Here is an example
I have a SQLite3 table with a column having format DECIMAL(7,2), but whenever I
I have Table1 and Table2 related on Table1.ID. There can be zero or more
i have table structure with 3 colums (column1, column2, column3) and i want to
I have table with 3 columns A B C. I want to select *

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.