SQL Sam and the Too-Slow Query - Part 1 | Database Journal

SQL Sam and the Too-Slow Query – Part 1

Written By
Steve Hontz
Steve Hontz
Aug 25, 1999
2 minute read

SQL Sam and the Too-Slow Query – Part 1

Environment: SQL Server 6.5, SP4


Turn ON clues

A familiar shadow fell across the anti-glare screen of SQL Sam’s workstation at Books-R-Us.
"Hello, Tulsa," Sam grinned, looking up. "Haven’t seen you in a while…"

Tulsa Jones brushed back an errant lock of platinum-blonde hair. "Well, Sam, it’s been pretty busy around here
since we installed the new Bookworm 2 software upgrade," she said.
Tulsa was the manager in charge of all the Books-R-Us customer service representatives. She had provided much
of the information behind the database design for Bookworm 2, the
application the agents used to handle customer’s book orders.

"Yes, there were a few unexpected glitches, but the database seems to running smoothly now," said Sam.

"Thanks to you, Sam. But you know, there is still one problem that pops up every now and then," said Tulsa.
"Sometimes the agents report time-out errors when they’re waiting to look at the order details for
a particular order number. The time-out is thirty seconds, and it doesn’t happen often, but none of the
agents remember it ever happening before the upgrade."

"Let’s take a look," said Sam. "What’s the table involved?"

"It’s called ‘order_details‘. There- that’s it," she said, pointing at the window Sam had brought up:

"It’s keyed by the order number and the item number. When the agent selects a particular order
number, the details window shows the individual items in the order."

"Okay, it’s time to do a SQL Trace," said Sam.

Continue with SQL Sam and the Too-Slow Query

Go to the solution now!

Back to SQL Sam Cases


Steve Hontz is President of The Bit
Corner, Inc.
, a Phoenix-based consulting firm
specializing in Windows NT, C++, and SQL Server
development. You can reach him at
steve@bitcorner.com.


Database Journal Logo

DatabaseJournal.com publishes relevant, up-to-date and pragmatic articles on the use of database hardware and management tools and serves as a forum for professional knowledge about proprietary, open source and cloud-based databases--foundational technology for all IT systems. We publish insightful articles about new products, best practices and trends; readers help each other out on various database questions and problems. Database management systems (DBMS) and database security processes are also key areas of focus at DatabaseJournal.com.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.