Tag Info

New answers tagged

2

SUGGESTION #1 Based on the WHERE clause, I highly recommend a compound index ALTER TABLE mytable ADD INDEX (md5,created_at); That way, all parts of the WHERE clause are answered by the index. SUGGESTION #2 Since you are imposing a limit of 200, collect the 200 keys first, then join the keys SELECT B.* FROM ( SELECT id FROM mytable WHERE md5 = ...


1

Go for md5(15) because it has better cardinality and ref always beats range in performance. You wrote LIMIT 200 without ordering clause. Just heads up.


2

You can use the admin command: db.adminCommand({setParameter:1, ttlMonitorEnabled:false}); To re-enable, use the same command with true.


0

First thing you should do is Apply SQL Server 2008 R2 SP3 ASAP. This is because SQL Server 2008 R2 RTM version is not supported at all by Microsoft. There are lots of fixes which have been included in this Service pack release and that would surely benefit SQL Server query performance. You asked, So rebuild all indexes is good idea ? NO IT IS NOT. ...


3

There a number of approaches to tuning XML queries in SQL Server. Property promotion is a good one, but I also regularly use the following: XML Indexes Best practice syntax XML Schema Collection Full-text Indexing XML Indexes XML Indexes can transform XML query performance, but at a cost. Pre-SQL Server 2012, they come in two types, primary XML ...


3

You should have a look at Property Promotion in XML Best Practices for Microsoft SQL Server 2005. Create a user defined scalar valued function that extracts the value you need and use the function as a computed column in your table. You can persist the column of you like and you can create a regular index on the column. You don't have to persist the column ...


2

According to your sample query, you must have two separate NonClustered Indexes on Session_id column for both tables. Further it must contain columns that are being used by SELECT clause to avoid bookmark lookups. Fill factor for indexes on uniqueidentifier: If only key column (like in your case) is uniqueidentifier then you can fill all the page (Fill ...



Top 50 recent answers are included