1,665 reputation
724
bio website
location Austin, TX
age 33
visits member for 3 years, 10 months
seen 2 days ago

Mar
12
comment Which should I use on my DB? - Clustered Index or Non Clustered Index or Both
+1. Another reason to cluster on the date field (first; you may have other fields subsequent in the clustering key) is that dates are typically used for ranges. A range lookup on a clustered index is very efficient.
Mar
12
comment Is this MERGE statement correct?
No, you reference E14_LOAD, but I see no such table. That's a syntax error, which your SQL editor should call out for you. I'm not sure this is a DBA question.
Feb
27
comment Optimizing queries for 25+ million rows
So is the query you're trying to optimize for SELECT COUNT(*) FROM MyTbl WHERE Table = @X AND Field = @Y AND After = @Z AND Date BETWEEN @A AND @B? I agree with ypercube, if you can't add indices you're... very limited.
Feb
25
comment MySQL requires FORCE INDEX on huge table and simple SELECTs
What's the cardinality of Source? Are some values much more common than others, and are those the ones which run faster with the date index?
Feb
25
revised Should I use a compound or surrogate PK in a many-to-many table?
Added a more specific title, and trimmed the needless tag prefix in the title
Feb
25
suggested approved edit on Should I use a compound or surrogate PK in a many-to-many table?
Feb
25
comment Primary keys: composite and singular
To my astonishment, I cannot find an existing question on this topic on DBA. It is discussed on SO (stackoverflow.com/questions/107404/…), however.
Feb
24
comment How to reduce database size with BLOB fields
What exactly is the SELECT statement? Is there something stopping you from NOT including the BLOB field in your select list?
Feb
20
comment How can I invoke an SSIS package from SQL Agent, via T-SQL, using a proxy
Is it necessary that the SSIS jobs run through SQL Agent? I've done similar things, but used SQL Agent to launch my app, which in turn launched dtexec, called sprocs, performed file operations, etc.
Feb
20
comment SQL Server choose at random from giving data
This has been examined in detail on Stack Overflow (stackoverflow.com/questions/848872/…). Curiously, we don't seem to have the same question here on DBA yet though.
Feb
20
comment Order In WHERE Clause Matter For SARGability?
You can answer this for yourself by comparing the execution plans. If you'd like to post them, we can clarify for you how each plan is using specific indices.
Feb
18
answered How to efficiently create a new PRIMARY KEY CLUSTERED definition online
Feb
10
comment Should database be denormalized if I need an index across multiple tables
@dezso: I agree with your materialized view suggestion. How about you add it as an answer?
Feb
9
comment SSRS Reports Manager Security Configuration
Cross-posted as stackoverflow.com/questions/20274485/….
Feb
9
comment Help with ER design
There are a number of similar questions on DBA: basically "should I create a zillion columns even though some records won't need them all" or "should I abandon traditional database design and use a key-value store"? Most of the time, columns are the better answer. NULLs don't require much space to store, and the alternatives (parsing comma-separated values or XML, joining multiple attribute records) tend to perform very poorly.
Feb
6
comment Is a clustered index on a child table in a parent/child relationship the most optimal index?
My understanding is that the "clustered index hotspot" problem is not real in modern versions of MS SQL (dba.stackexchange.com/a/1586/1896).
Feb
2
comment Foreign Key NULL vs Foreign Key to an empty string
In addition to Erwin's excellent answer, a filtered index can't be used to efficiently retrieve all generic medicines. If you use a specific value for "N/A; generic", an index on that field will work just fine.
Jan
30
comment Manage multiple short-term tables with same schema or use single table for short-term data?
Has your team already considered and rejected #temp tables?
Jan
29
comment Moving data from table with VARCHAR(50) fields to table with numeric fields increases table size
If you'd like to compact the table where it stands, it looks like this is covered on SO: stackoverflow.com/a/808368/565869.
Jan
29
comment Moving data from table with VARCHAR(50) fields to table with numeric fields increases table size
Did you import the data into table A, then ALTER TABLE to make it into table B? Try creating table B from scratch and then importing the data into it.