THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

John Paul Cook

A Full Table Scan Good for a Lifetime

How many people can say that they’ve done a manual full table scan for their valentine? I can.

When I first met my wife, she introduced herself as “[FirstName] +  [LastName]”, however my brain encountered an “OH, WOW!” error and stopped processing after her [FirstName]. I didn’t want to ask her or anybody else what her [LastName] was, lest she think I wasn’t paying enough attention to remember (when, really, the exact opposite was true). In today’s high-tech world, this would not have been a problem, but we met long before the internet and search engines.

Over the next few months, I saw my wife many times at church and at school (I was a graduate student; she was on staff). But never was her [LastName] again presented to me. One day, she stopped by my townhouse when I wasn’t home. She left a note that only said “Call me.”, followed by her [PhoneNumber] and her [FirstName]. I wanted to keep my secret safe, so I had only one option – the phone book. I spent the next several hours conducting a manual scan of the Galveston white pages. I started on the first page and just kept reading until I found her phone number. It appeared in the W’s. At last armed with the knowledge of my valentine’s [LastName], I made the call.

We’ve been married over 25 years now.

Published Saturday, February 14, 2009 1:37 AM by John Paul Cook
Filed under:



jacobsebastian said:

Congratulations John!

I am pretty sure this table scan is much memorable than an index-seek.



February 14, 2009 8:24 AM

Bernd Eckenfels said:

This is so sweet. But.. umm... uh... your.. secret... it is now not secret anymore :)

February 14, 2009 1:24 PM

jchang said:

this is precisely the reason SQL Server needs correlated column statistics (it does at the vector level, but not at the histogram).

so then men know that


WHERE Attractiveness > 9 AND MonthlyShoppingExpenses < $3000

and women know that


WHERE FinancialStability > 9 AND Fidelity > 9 AND IsSingle > 50%

all yield zero or nearly zero rows.

The individual column statistics may indicate 10% on each column condition, leading one to think that the combined AND conditions yields 1%, which will still have a respectable row count output, when in fact, if correlation is taken into account, a drastically different row count.

Yes, I know, get a life, and I have been called MCP before the MS MCP program existed.

February 16, 2009 10:42 AM

Val Intyne said:

Gee, not much has changed in 25 years!

February 26, 2009 12:07 AM

Jamie Hudson said:

Awe - I love a good love story. Thanks John.

February 15, 2012 11:41 PM
Anonymous comments are disabled

About John Paul Cook

John Paul Cook is a database and Azure specialist in Houston. He previously worked as a Data Platform Solution Architect in Microsoft's Houston office. Prior to joining Microsoft, he was a SQL Server MVP. He is experienced in SQL Server and Oracle database application design, development, and implementation. He has spoken at many conferences including Microsoft TechEd and the SQL PASS Summit. He has worked in oil and gas, financial, manufacturing, and healthcare industries. John is also a registered nurse recently completed the education to become a psychiatric nurse practitioner. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2. Connect on LinkedIn

This Blog



Privacy Statement