PostgreSQL Events – A Newbies Perspective: #PGSQLPhriday 014

PostgreSQL
For this month's #PGSQLPhriday 014 blogging event, Pavlo Golub has asked a pretty simple question: What do you think about PostgreSQL events? Prior to this year, I'd never attended an event focused on PostgreSQL. Heck, I'd never attended an event that had an intentional track or learning pathway, or whatever, focused on PostgreSQL. In the past year though, I've now attended four. As a complete newbie, let me tell you a little bit about the PostgreSQL community as I see it. Welcoming The very first word that comes to mind when I think about the PostgreSQL community is that it is welcoming. Like the SQL Server community that I've been practically living with for the last almost 20 years, the people who make up the PostgreSQL community are very kind,…
Read More

Query Store Reports Time Intervals

SQL Server
A great question came up over at DBA.StackExchange regarding the query store reports time intervals: How can SQL Server's Query Store Reports show data for minute-length intervals, when "Statistics Collection Interval" is set to 1 hour? I was intrigued because it's not something I had thought about at all. How Does the Report Decided on Time? The first thing you need to know is that all performance information inside Query Store is aggregated. By default, the aggregation interval is 60 minutes. You can adjust that up or down (although, I wouldn't recommend making it too granular, you'll see a massive increase in storage size). It's aggregated because trying to capture every execution of every query, as anyone who has done it using Extended Events knows, is expensive and has a…
Read More

T-SQL Tuesday #166: Wrap-up

SQL Server
Once more, my apologies for being late on getting the T-SQL Tuesday announcement out. I have no excuse. However, our extended event on Extended Events (yes, I'm the third person to make this joke, yes, I'm blatantly stealing) still has several entries, so let's talk about them. Let's get mine out of the way. I was simply curious what the search engines revealed when I asked a pretty common question: how do you identify slow queries? What I found was, the answers on most search engines to this question are old, very old. Not to say wrong, but since many of them were created before a working version of Extended Events (let alone Query Store) was released, how could they tell you. On to actually good posts. One of my…
Read More

T-SQL Tuesday #166: Why Not Extended Events?

SQL Server
With 165 T-SQL Tuesday events, two, just two, this one, T-SQL Tuesday #166, and another one back in 2018 or 2019 (I forget and I'm far too lazy to go look) have been on Extended Events. At conferences I'm frequently the only one doing sessions on Extended Events (although, sometimes, Erin Stellato is there, presenting a better session than mine). I did a session at SQL Konferenz in Germany earlier this week on Extended Events. Hanging out in the hallway at the event (which was great by the way), I was talking with some consultants. Here's their paraphrased (probably badly) story: "I was working with an organization just a few weeks back. They found that Trace was truncating the text on some queries they were trying to track. I asked…
Read More

T-SQL Tuesday #166: Extended Events

T-SQL
When I was put on the list to host September's T-SQL Tuesday, well, I forgot to put it in my calendar. So I'm late (and in the doghouse with Steve). Because of this, I'm going to bend the rules a little (sorry Steve) and give you a few days to get your posts together. In theory, they're all due tomorrow, Tuesday, September 12. However, let's say they're all due by the end of the day on Thursday, September 14th. My apologies for being tardy. I'll still post a roundup on Friday. So, what's the topic for T-SQL Tuesday. Well, it's in the title, Extended Events. Let's talk about it. Why Extended Events? As anyone who has read my blog or books, or seen me speak, you'll know that I've got…
Read More

State of the Database Landscape Survey 2023

Professional Development
As data professionals, of any stripe, we should, as much as we can, where we can, base our decisions on data. After all, in theory anyway, we're the experts at making that possible for others. We should lead the way on it. However, how do you know how others are implementing, oh, I don't know, cloud migrations, or multi-platform database management? What kind of success are they having? Where are they facing challenges? Well, one mechanism for answering these questions this is to simply ask. State of the Database Landscape Survey 2023 Yep. That's exactly what we're doing. We're asking you, and your peers, how you're doing. More, we're asking you how you're doing it. Please, help us out. Follow this link and fill out your information. Whether you're literally…
Read More

Battle of the Query Hints in Query Store

SQL Server
I recently presented a session on the Query Store at Data Saturday Rhineland and the question came up: If there's already a query hint on a query, what happens when you try to force a similar query hint? Yeah, OK, that is a weird one. I don't know the answer, but I'm about to find out. Setting up the Battle I've got this simple procedure I use a lot to illustrate bad parameter sniffing. In AdventureWorks, this query can produce up to five different plans, depending on the values called. Most of the time, it's one of two plans, which I'll get to in a minute. Here's the query: CREATE OR ALTER PROC dbo.ProductTransactionHistoryByReference (@ReferenceOrderID INT) AS BEGIN SELECT p.Name, p.ProductNumber, th.ReferenceOrderID FROM Production.Product AS p JOIN Production.TransactionHistory AS th…
Read More

PGSQL Phriday #009: On Rollback

PostgreSQL
The invitation this month for #PGSqlPhriday comes from Dian Fay. The topic is pretty simple, database change management. Now, I may have, once or twice, spoken about database change management, database DevOps, automating deployments, and all that sort of thing. Maybe. Once or twice. OK. This is my topic. I've got some great examples on taking changes from the schema on your PostgreSQL databases and then deploying them. All the technical stuff you could want. However, I don't want to talk about that today. Instead, I want to talk about something really important, the concept of rollbacks when it comes to database deployments. Why Are Rollbacks Difficult? The entire purpose of your PostgreSQL database is to persist, that is to store, the data. Then, of course, offer up a way…
Read More

Why Put PostgreSQL in Azure

PostgreSQL
I've had people come up to me and say "PostgreSQL is open source and therefore license free. Why on earth would I put PostgreSQL in Azure?" Honestly, I think that's a very fair question. The shortest possible answer is, of course, you don't have to. You can host your own PostgreSQL instances on local hardware, or build out VMs in Azure and put PostgreSQL out there, some other VM host, or maybe in Kubernetes containers, I mean, yeah, you have tons of options. So why PostgreSQL in Azure, and specifically, I mean the Platform as a Service offering? Let's talk about it. PostgreSQL in Azure Let's assume for a moment that you're PostgreSQL expert (I'm not, but I do play one on TV). You know exactly how to set up…
Read More

ChatGPT Lied To Me

Data Science
I've been seeing more and more noise about how ChatGPT can help with technical stuff, writing code, all that. Well, I wanted to know how best to set up Query Store in SQL Server 2022, so I asked it. I'm not going to say this any other way, ChatGPT lied to me. Here's the conversation. I'm in italics. The Conversation With ChatGPT What are the best settings for Query Store in SQL Server 2022 Query Store is a powerful feature in SQL Server 2022 that helps in monitoring query performance and identifying query regressions over time. However, setting up Query Store requires careful consideration of several factors, including the size of the database, the frequency of queries, and the query workload. Here are some best practices for configuring Query Store…
Read More