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 525159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:38:33+00:00 2026-05-13T08:38:33+00:00

i have a table with columns A and B which are correlated in the

  • 0

i have a table with columns A and B which are correlated in the following meaning:

A == 1 => B == 3
A == 2 => B == 0
A == 3 => B == 7

with => meaning implies with high probability. I want to query like this:

where A = 2 and B = 3 --very few rows should match

so i have created statistics on (A, B). however the query optimizer completely misestimates the rowcount by a factor of 10. any ideas why? the joint histogram should allow for a very precise estimate. btw: cardinality(A) = 10, cardinality(B) = 5

  • 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-05-13T08:38:34+00:00Added an answer on May 13, 2026 at 8:38 am

    I suspect the optimiser is ignoring the statistics because the whole query matters, not just the WHERE clause. Or you have SELECT *. Or the sample rate is too low (did you use FULLSCAN?)

    What if you create an index, which has index statistics? With inclusions too to make it covering?

    I’ve never created my own column statistics (unless a graphical query plan has mentioned it). If I need to create them, an index is highly likely to serve my purposes better

    Edit:

    • Another SO question:
    • SQLServerPedia article
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with 3 columns which looks like this: File User Rating
I have a mysql table which columns are post_id and post_msg. Now I want
I have a table with many columns among which I'd like to omit a
I have a table with 3 columns which have the following values in the
I have table which contains columns like SiteID (identity_Col) SiteName POrderID Location Address Cluster
if i have a table which has columns with fixed lenght, Will mySQL count
i have a table with columns ID,SUBJECT,BRANCH i have select the rows which satisfies
I have a table called order which contains columns id , user_id , price
I have a table which has the below columns. Ticket_id (Primary key, Int) Attachment1
I have a table y Which has two columns a and b Entries are:

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.