In relation to this question: How can I help the optimizer estimating better?

No histogram is returned by the tools for varchar columns. Instead one shall use the Estimate function to check for the selectivity the optimizer is anticipating for a certain value.

Therefore I am wondering if Create Statistics or Drop Statistics will have any effect for varchar columns?

asked 26 Jul '11, 03:22

Martin's gravatar image

Martin
8.6k116150237
accept rate: 14%


CREATE and DROP STATISTICS work for string values as well as numeric values. For strings, the histogram "buckets" are really frequent-value statistics, since with strings of arbitrary length there isn't a useful "width" to use as the bucket size, as there are for ordered, numeric domains such as integers.

The reason that a histogram is not returned is that the frequent-value statistics are hashed, and their internal representation isn't convertible into a useful form that would make sense to an application developer.

permanent link

answered 26 Jul '11, 12:02

Glenn%20Paulley's gravatar image

Glenn Paulley
10.7k571104
accept rate: 43%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×27
×11

question asked: 26 Jul '11, 03:22

question was seen: 696 times

last updated: 26 Jul '11, 12:02