• What a great article! I've been pointing a lot of other people to it now that I've found it, because it summarizes my own experience so well.

    Although I have to wonder if half the people who replied actually read your article, the points raised by SQLGuru are valid. Also, the distinction between constraints and indexes is a good one and may solve your personal issue.

    As for teaching developers to write indexes: a lot of developers can't even get their heads around the create table-statement. Asking them to create indexes willy-nilly is a recipe for disaster, especially combined with the valid objections raised by SQL Guru. I've seen DBA's go on a 3-day course about indexing. That sort of investment is out of the question for most developers, who'd rather spend those days on a development course.

    No, the DBA is the one with both the knowledge *and* the access to the database. He or she should do this, just as much as tuning the server performance in any other way is a DBA-job, not a job for a developer. The developer is about the right algorithm, the correct join and the checking of constraints. The DBA about the best performance given the limitations of the hardware. And while you can combine the functions in one person, in large operations this is just not feasible given the workload.

    Is it the job of the developer to know and remain aware of whether the production server has 4 or 8 cores? 1 or 16 GB of memory? SSD's or SAN? RAID configuration? If the answer is no, then the developer doesn't have the knowledge to index anything and you should leave it to the pro.

    Production databases for testing... sure, could be done. But it puts specialized work with an untrained person, and incurring a heavy workload on the DBA to just copy data to and fro, while also maintaining responsibility for making sure all sensitive data is scrubbed. It has the specialist doing generic filler work, and the generalist doing specialist work. It's putting the horse behind the cart, IMO.

    No, while I think automating index deployment is very risky, and the DBA should automate indexing with some care, the DBA is the right person to determine indexing strategy.