Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
159618 stories
·
33 followers

New Claude Plugin For SQL Server Query Plan Analysis

1 Share

New Claude Plugin For SQL Server Query Plan Analysis


Chapters

Full Transcript

Erik Darling here with Darling Data, continuing my fast ascendancy to monitoring tool mogulhood. What you see in the background is the latest iteration in advance in my free open source SQL Server monitoring tool. This is going to be the enterprise edition of it, but we’ll talk more about that later.

What I want to talk about in this video is a new Cloud Marketplace skill that you can see chugging away here in the background. And what it aims to do is take the analysis engine from my performance studio application, which includes plan parsing and analysis rules and all sorts of other stuff, and hand them over to an agent.

So you can use Cloud, of course, but there are poor unfortunate souls in the world who are forced to labor under the drudgery of GitHub Copilot. And I feel bad for them because Copilot is just plum embarrassing. I would smack the words out of its mouth if it were a human.

It is… There aren’t words for it. It’s dumb. But a friend of the repo, Hannah Vernon, was nice enough to open a pull request to give our imbecilic Copilot LLM access to this as well.

So hopefully you will gain some respite from its moronics. But back to the tool at hand. We have a Cloud agent here looking at a query plan that I gave it.

You can see up at the top it said, Hello, Cloud, can you tell me why this query plan is so gosh darn slow? And the Cloud pulled up the skill that I gave it.

Up here, let me look. Successfully loaded this skill. And now Cloud is chugging away. Analyzing the query plan with my analysis engine.

And you can see it using all that. And the reason why I did this is because I got so tired of re-explaining execution plan minutiae either to a new Cloud agent locally or abroad. You have to say like, no, I don’t want to hear about logical reads.

No, I don’t care about operator costs. No, Cloud, row mode operator times are cumulative. Batch mode operator times are cumulative. Batch mode operator times are insular.

No, that’s not what that wait step means. No, buddy, what are you doing? So I got very tired of having to do that over and over again and basically have to retrain every Cloud that I talked to on SQL Server execution plans. And so I have another agent working on the monitoring tool stuff in the background.

You’ll see that pop back up in a moment. So this Cloud has finished its analysis. And what it’s saying here is, well, let’s scroll back up a little bit.

And at any moment, the other dashboard is probably going to pop up and get in my way. But in the meantime, so we have an answer here. And Cloud is smart enough to see that we have an eager index pool.

It is 98% of the query runtime. It’s 69.726 milliseconds. And it explains what the query is doing.

All right. And it tells you that SQL Server built an index for this at runtime. And, wow, it’s roughly 32 gigs of pages.

Whoo-wee. That is a long time. All right. And it read 17.1 million rows to hand back 81,000. That’s a lot of work.

All right. And it also notes here that, well, I mean, I don’t know if I particularly agree with this. So, like, the tool can only do so much.

All right. It can still say, like, menacingly dumb things sometimes. All right. But it does understand that this is a .4 plan doing serial work and paying full freight for the privilege. Well, that’s a hell of a sentence there.

That sentence is doing some work. All right. And we see here, all right, Cloud knows that exec sync in a parallel plan indicates that an eager index pool is being built. All right.

All right. It could pop up for other reasons, but, you know, for our case, it is correct. All right. And now if we look down here, we even have Cloud smart enough to know if you create this index, my friend, the eager index pool will go away. All right.

The mechanism concretely, they both vanish from the plan if we have this index in place. All right. So it’s even cool. All right.

It’s even cool enough to know. We don’t get a missing index. We don’t get a missing index request from this plan because we don’t we don’t because SQL Server does not emit a missing index request when there is an eager index pool. All right.

So that’s good, too. All right. And it even tells you don’t waste your time with all this stuff. Just create that index. All right. So if you would like to try this new Cloud or Idiot GitHub copilot plug-in, there are a number of ways to do that. All right.

So if you would like to try this new Cloud or Idiot GitHub copilot plug-in, there are instructions to do that down in the video description along with a link to the GitHub repo where all the code lives in case you want to take a look at it. Maybe you even want to have your own robot, give it a once over to see if there’s anything that you might care about changing or contributing in there. I’m happy to take contributions on these things.

But you can do that. Anyway, thank you for watching. I hope you enjoyed yourselves. I hope you learned something. I hope you enjoyed my new Cloud and or Idiot GitHub copilot plug-in that makes execution plan analysis go a lot better than it normally would if you were to just leave the robots to their own devices because their own devices are often not very good.

So if I could say just one last thing in closing, it’s that, you know, like I feel comfortable using the robots for certain query tuning tasks. tasks because i i know enough to to tell the robots when when they’re full of it but i i worry about the the folks out there who don’t know and who get the robot saying criminally insane things to them and criminally wrong things to them and then this being like oh wow that sounds so sure of itself i ought to do that it like it’s it’s rough right like like it like like they’re they’re very good at logically like you know looking at things and logically sort of like chaining things together but um man uh the the the advice and analysis portion is uh often difficult to overcome but uh this this will hopefully make it better anyway give it a shot it’s kind of kind of fun to have uh claude not be or kind of have kind of fun to have an llm not be be completely lost in a query plan anyway thank you for watching

Going Further


If this is the kind of SQL Server stuff you love learning about, you’ll love my training. Blog readers get 25% off the Everything Bundle — over 100 hours of performance tuning content. Need hands-on help? I offer consulting engagements from targeted investigations to ongoing retainers. Want a quick sanity check before committing to a full engagement? Schedule a call — no commitment required.

The post New Claude Plugin For SQL Server Query Plan Analysis appeared first on Darling Data.

Read the whole story
alvinashcraft
11 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Replit Introduces Free Mode to Expand What is Possible with AI

1 Share
AI models are now capable and affordable enough to make once-unreachable outcomes practical. The opportunity for everyone to pursue and collaborate on ambitious ideas, spend less time on busywork, and raise the quality and creative output across disciplines is nearly here. The possibility is here. But for most people, the reality is not. Replit users are already building million-dollar businesses, replacing legacy software and saving hundreds of thousands of dollars, and increasing their everyday potential by creating high-quality software, designs, slides, and more.

Read the whole story
alvinashcraft
5 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Top Album Releases Linked To Rise In Fatal Crashes

1 Share
An anonymous reader quotes a report from The Guardian: The release of a new album by Taylor Swift might be a cause for celebration among her fans, but such events have also been linked to a more sombre phenomenon: an increase in fatal car crashes. The team behind a new study say it sheds light on the impact of distracted driving. Writing in the journal Jama Network Open, [Vishal Patel, first author of the study based at Harvard Medical School] and colleagues report how they focused on the release of 10 major albums, launched between 2017 and 2022, selected for having the highest number of Spotify streams over a single day. [...] The team found streaming volume for the top 200 songs in the US was 43% higher on the date of major album releases compared with the days surrounding the releases -- although such data does not reveal whether the music was being streamed in a car. [...] The researchers used data from a population-based registry of fatal US motor vehicle crashes to look at the number of traffic fatalities on the dates these albums were released, as well as for the 10 days either side. After taking into account the day of the week upon which the album was released, as well as federal holidays, and time of year, the researchers found the number of US traffic fatalities showed a relative increase of 15.1% on the date of major album releases, compared with similar days either side. "This is equivalent to approximately 182 fatalities in the US attributable to the release days of the 10 included albums," the team writes. Patel said the release of a new album could distract drivers because accessing music is a search task, not a single button press. "You unlock the phone, open the app, find the release, read down a tracklist, tap the right song. That's several seconds of looking at a screen," he said, adding unfamiliar music also demands more attention, while research has suggested listening to new, high-energy music measurably degrades driving performance. The researchers add the rise in traffic fatalities was greater among certain groups -- such as younger drivers, male drivers, people who were driving alone, and people driving cars with a built-in infotainment platform. The authors say the results suggest that "online music streaming through smartphones may significantly contribute to distracted driving and traffic fatalities."

Read more of this story at Slashdot.

Read the whole story
alvinashcraft
5 hours ago
reply
Pennsylvania, USA
Share this story
Delete

Advanced Prompt Engineering for Software Developers: Frameworks, Patterns, and Best Practices

1 Share
Advanced Prompt Engineering for Software Developers: Frameworks, Patterns, and Best Practices

As foundation models become integral to modern software architecture, the ability to instruct large language models with precision and determinism has evolved into a vital engineering competency for developers across India and globally.

 

In this technical guide, we explore advanced prompt engineering methodologies, structural design patterns, context optimization strategies, and robust schema enforcement techniques to build production-grade AI-powered applications.

 

Advanced Prompt Engineering for Developers
Engineering robust system prompts, structured reasoning chains, and deterministic AI workflows.

 

Table of Contents

 

  • Understand the transition from conversational prompting to deterministic, software-driven prompt architecture.
  • Master core reasoning patterns including Few-Shot Learning, Chain-of-Thought (CoT), and ReAct orchestration.
  • Learn proven techniques for enforcing strict JSON outputs and strongly typed schema validation in production.
  • Optimize context windows and mitigate token bloat using semantic compression and strategic placement.
  • Implement defensive prompt design to prevent prompt injection attacks and eliminate model hallucinations.

The Transition from Casual Chatting to Deterministic AI Engineering

In the early days of generative models, prompting was often viewed as trial-and-error conversational art. Users experimented with phrasing until the model produced a visually pleasing answer. However, integrating models into enterprise software pipelines demands repeatability, predictable latencies, and strict adherence to data contracts.

 

Deterministic prompt engineering treats the language model as an untyped compute engine that requires explicit system instructions, well-defined state schemas, and rigorous constraint boundaries to function reliably alongside backend services.

 

Effective prompt engineering is not about finding magical keywords; it is about structuring context, defining operational boundaries, and eliminating ambiguity.

 

If you are exploring the latest developer tools to streamline this workflow, our review of top AI coding tools and IDE extensions covers the leading terminal assistants and prompt testing platforms available today.

 

Furthermore, mastering these techniques has become indispensable for career advancement. You can explore our insights on essential technical skills for career growth in modern tech to see why human-AI collaboration is shaping hiring priorities.

 

 

 

Core Prompting Patterns: Few-Shot, Chain-of-Thought, and ReAct

To extract high-accuracy logical reasoning from language models, software developers rely on several structured patterns that guide the model through intermediate cognitive steps before producing a final answer.

 

Selecting the appropriate prompting pattern depends on whether your task involves classification, multi-step algorithmic calculation, or dynamic external tool invocation.

 

Abstract software architecture and data streams
Architecting structured multi-step reasoning frameworks and dynamic tool integration.

 

Essential Prompting Design Patterns

  • Few-Shot In-Context Learning: Providing 3 to 5 clear input-output pairs inside the prompt establishes the exact stylistic tone, response syntax, and domain vocabulary far more effectively than lengthy descriptive explanations.
  • Chain-of-Thought (CoT) Prompting: Explicitly instructing the model to break down complex mathematical or architectural decisions into sequential logical steps drastically reduces arithmetic regressions and false assumptions.
  • Reasoning and Acting (ReAct): Interleaving cognitive reasoning traces with external tool invocations allows the model to observe execution outputs, reflect on runtime errors, and iteratively refine API calls until the goal is achieved.
  • Skeleton-of-Thought (SoT): Guiding the model to first outline a high-level response skeleton before expanding each section in parallel reduces output latency for long-form code generation and technical reports.

Combining these structural patterns ensures that the model maintains deep contextual awareness across complex, multi-stage engineering workflows.

 

 

 

Enforcing Structured JSON Outputs and Strict Schema Validation

When connecting language models to backend microservices, databases, or UI components, unstructured free-form text is completely unacceptable. Developers require strictly typed JSON objects that can be parsed and validated without runtime exceptions.

 

Modern foundation models support native JSON Schema enforcement and grammar-based decoding, guaranteeing that every generated token conforms strictly to your data model.

 

Best Practices for Structured Output Generation

  • Define Explicit TypeScript or Pydantic Interfaces: Embed verbatim interface definitions directly in your system prompts to clearly signal required fields, optional properties, and valid enum values.
  • Constrained Grammar Decoding: Utilize provider-level structured output parameters (such as response_format with JSON schemas) to restrict model token generation strictly to valid JSON grammar at the sampling layer.
  • Defensive Error Handling and Fallbacks: Always wrap parsing logic in try-catch blocks and implement secondary validation passes to catch schema mismatches before mutating production databases.

Adopting rigorous schema validation transforms language models from creative toys into dependable microservice building blocks.

 

 

 

Context Window Optimization and Token Efficiency

While modern foundation models boast context windows spanning hundreds of thousands of tokens, casually packing massive document repositories into a single prompt leads to substantial latency spikes, high API costs, and context degradation.

 

The infamous "needle-in-a-haystack" phenomenon demonstrates that models often pay higher attention to information positioned at the very beginning and the very end of a prompt, while occasionally overlooking critical details placed in the middle.

 

To maximize accuracy while preserving token budgets, developers should implement semantic chunking, dynamic context trimming, and hierarchical retrieval before injecting reference data into the active prompt window.

 

When engineering high-throughput backend services that handle concurrent prompt pipelines, consulting our guide on enterprise cloud-native software engineering practices will help ensure optimal memory allocation and low-latency execution.

 

 

 

Defensive Prompt Design and Security Hardening

In production applications where user inputs are directly passed into LLM pipelines, security vulnerabilities such as Direct and Indirect Prompt Injections pose significant operational risks.

 

Malicious actors can craft adversarial prompts designed to hijack system instructions, leak private API keys, or bypass safety guardrails.

 

Hardening Strategies for Enterprise System Prompts

  • Clear Delimiter Boundaries: Wrap untrusted user inputs inside distinct XML tags (e.g., <user_input>...</user_input>) and instruct the model to treat content inside those tags exclusively as raw data rather than executable instructions.
  • Explicit Negative Constraints: State what the model must NEVER do under any circumstance, including instructions to ignore attempts to reveal internal system rules or role overrides.
  • Secondary Guardrail Evaluators: Deploy lightweight classification models or heuristic filters to inspect incoming prompts and outgoing responses for anomalous patterns before returning data to the client.

Just as in traditional software development, following best practices for rigorous code reviews and quality assurance ensures that your prompt templates undergo thorough peer verification before reaching production environments.

 

 

 

Frequently Asked Questions (FAQ)

Here are answers to the most common questions software developers have regarding advanced prompt engineering:

 

1. Is prompt engineering still relevant with reasoning models like o1/o3?

Yes. While reasoning models perform internal chain-of-thought, prompt engineering remains critical for defining objective constraints, context structuring, tool interfaces, output schemas, and security boundaries.

 

2. What is the difference between Zero-Shot and Few-Shot prompting?

Zero-Shot prompting asks the model to perform a task with only descriptive instructions. Few-Shot prompting provides several concrete input-output examples inside the prompt to illustrate the exact desired output format and reasoning style.

 

3. How do XML delimiters help prevent prompt injection?

XML delimiters create clear structural boundaries between developer system instructions and untrusted user input, making it difficult for an attacker to override system rules with malicious injection payloads.

 

4. Can I use prompt engineering to guarantee 100% valid JSON?

While prompt formatting helps, using native provider features like JSON Schema mode and constrained grammar decoding is the only way to mathematically guarantee valid JSON output at the token generation level.

 

5. What is the "Lost in the Middle" phenomenon in LLM prompts?

It refers to the tendency of language models to pay the most attention to tokens located at the start and end of a large prompt context, while occasionally missing nuances positioned in the middle third.

 

6. How does temperature affect prompt reproducibility?

Setting temperature to 0.0 minimizes randomness and makes outputs largely deterministic and focused, which is ideal for code generation, data extraction, and structured classification tasks.

 

7. What is ReAct prompting?

ReAct stands for Reason + Act. It is a paradigm where the model alternates between generating an explicit thought step, executing an action (like calling a tool or API), and observing the result to refine its next step.

 

8. Should I write system prompts in English or regional languages?

System instructions and structural rules are best written in English because foundation models have the deepest pretraining in English, though they can seamlessly process inputs and generate outputs in regional Indian languages.

 

9. What is Chain-of-Thought (CoT) prompting?

Chain-of-Thought prompting encourages the model to generate intermediate reasoning steps before arriving at a final answer, significantly improving accuracy on complex logic, math, and code debugging tasks.

 

10. How can I measure and benchmark prompt improvements?

You can create automated evaluation datasets (evals) with diverse test cases and run automated scoring using assertion tests, schema validators, or LLM-as-a-judge frameworks to track accuracy improvements over time.

 

Mastering prompt engineering bridges the crucial gap between raw AI model capabilities and robust software engineering practices. By treating prompt templates with the same rigor, version control, and automated testing as traditional application code, developers can build dependable systems that consistently deliver accurate results.

 

As you design your next AI-enabled feature, experiment with clear XML delimiters, integrate structured JSON schema validation, and evaluate your prompt changes against comprehensive benchmark suites.

 

I would love to hear about the prompt design patterns and optimization strategies that have worked best in your development stack. Feel free to share your experiences, questions, and insights in the comments section below!

 

Read the whole story
alvinashcraft
5 hours ago
reply
Pennsylvania, USA
Share this story
Delete

Welcome back to The GitHub Podcast!

1 Share

The GitHub Podcast is back for Season 2! In the season opener, Cassidy Williams is joined by co-hosts Marlene Mhangami and GPS Peña-Siguenza. The trio revisits their favorite moments from Season 1, including Keeley Hammond's take on Electron and why “bloated JavaScript” hot takes don't hold up, Angie Jones's conversation on MCP and Goose, and the Tiny Wins team's work fixing the everyday "paper cuts" that make life easier for open source maintainers. From there, the hosts dig into their own winding paths into tech. GPS’ shares her journey from sysadmin to .NET and Cloud Advocacy to building a free open source platform that teaches cloud fundamentals (now used by nearly 7,000 people). Marlene traces her path from studying molecular biology to becoming a fixture in the Python community, and her early open source work on CuDF at NVIDIA, advocating for Ibis at Voltron Data, then starting the LangChain Azure repository at Microsoft. Cassidy rounds out the episode with insights to her front-end and React roots and her early days making tech memes on TikTok. Finally, each host shares an open source pick of the week: Mediabunny, Handy, and Cua.

Links mentioned in the episode:

Electron

MCP

Goose

Learn to Cloud

CUDF

Ibis

Langchain Azure

Mediabunny

Handy

https://github.com/trycua/cua

CUA

The GitHub Podcast is produced and edited by editaudio.


Hosted by Simplecast, an AdsWizz company. See pcm.adswizz.com for information about our collection and use of personal data for advertising.





Download audio: https://afp-920613-injected.calisto.simplecastaudio.com/98910087-00ff-4e95-acd0-a3da5b27f57f/episodes/a8f898b3-c909-4a73-a0a9-c26ad10dbcbf/audio/128/default.mp3?aid=rss_feed&awCollectionId=98910087-00ff-4e95-acd0-a3da5b27f57f&awEpisodeId=a8f898b3-c909-4a73-a0a9-c26ad10dbcbf&feed=ioCY0vfY
Read the whole story
alvinashcraft
5 hours ago
reply
Pennsylvania, USA
Share this story
Delete

How People Are Fixing AI's Problems

1 Share
From: AIDailyBrief
Duration: 25:33
Views: 2,006

AI is solving old problems while creating entirely new ones. NLW looks at how people and companies are responding to AI slop, rising token costs, uneven productivity, workforce deskilling, and the long-term challenge of preserving human expertise.

The AI Daily Brief helps you understand the most important news and discussions in AI.
Subscribe to the podcast version of The AI Daily Brief wherever you listen: https://pod.link/1680633614
Get it ad free at http://patreon.com/aidailybrief
Learn more about the show https://aidailybrief.ai/

Read the whole story
alvinashcraft
5 hours ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories