The execution plan cache is a great feature: after SQL Server goes through the effort of generating a query plan, SQL Servers saves that plan in the plan cache to be reused again at a later date.
One downside to SQL Server caching almost all plans by default is that some of those plans won’t ever get reused. Those single use plans will exist in the plan cache, inefficiently tying up a piece of the server’s memory.
Take the next step to join Ad Hoc and work on government digital services that are fast, efficient, and usable by everyone. Once you have applied for an open position, try one of our homework assignments. Free direct download last version Adobe Photoshop Lightroom S Apk Android from RK TIPS AND TRICKS. Bring beautiful images to light with Adobe Lightroom. Powered by the magic of Adobe Photoshop technology, Lightroom for mobile enables you to craft and share professional-quality images from your smartphone or tablet.
Today I want to look at a feature that will keep these one-time use plans out of the plan cache.
Plan Stubs
Instead of filling the execution plan cache with plans that will never get reused, the optimize for ad hoc workloads option will cache a plan stub instead of the full plan. The plan stub is significantly smaller in size and is only replaced with the full execution plan when SQL Server recognizes that the same query has executed multiple times.
This reduces the amount of size one-time queries take up in t he cache, allowing more reusable plans to remain in the cache for longer periods of time.
Enabling this server-level feature is as easy as (a database scoped versions :
Once enabled you can watch the plan stub take up less space in the cache:
Now if we run our second query filtering on UserName LIKE ‘B%’ again and then check the plan cache, we’ll notice the stub is replaced with an actual compiled plan:
The downside to plan stubs is that they add some cpu load to our server: each query gets compiled twice before it gets reused from cache. However, since plan stubs reduce the size of our plan cache, this allows more reusable queries to be cached for longer periods of time.
Great! All my cache problems will be solved
Not necessarily.
If your workload truly involves lots of ad hoc queries (like many analysts all working on different problems or dynamic SQL that’s generating completely different statements on every execution), enabling Optimize for Ad hoc Workloads may be your best option (Kimberly Tripp also has a great alternative: clearing single use plans automatically on a schedule).
However, often times single-use query plans have a more nefarious origin: unparameterized queries. In this case, enabling Optimize for Ad hoc Workloads may not negatively impact your server, but it certainly won’t help. Why? Because those original queries will still be getting generated.
Brent Ozar has a good overview of why this happens, but the short answer is to force parameterization on your queries. When you enable force parameterization, SQL Server will not automatically parameterize your queries if they aren’t already, reducing the number of one off query plans in your cache.
Midi file converter smf 16. Whether you are dealing with too many single use queries on your server or some other problem, just remember to find the root cause of the problem instead of just treating the symptoms.
Thanks for reading. You might also enjoy following me on Twitter.
Steps to Distribute an iOS App using a Website
One of the challenges that exist in an iOS dev shop, is how to distribute your app to devices for Beta testing. The Ad-hoc process that Apple supplies for creating an app for distribution is well documented. But how do we actually get the app on to our devices for beta testing. Wouldn’t it be great if we could just compile our app and put the app out on a website, then someone using an iOS device could just go to the website and install the app with a tap on a link. Best of all when ever you have a new version of the app you can just upload the app to the website and the users can just reinstall. Here I’m going to show you how to do it. It should take 10 minutes from start to finish.
Overall Process
- Get the UDID from new device using iTunes
- Add the device to portal
- Create a distribution profile
- Add the device to the distribution profile
- Synch Xcode to bring in the new profile
- Code sign your app with the new profile
- Build the app for archive, create the app for distribution
- Move the app, manifest file, profile to a website (code is included below)
- Create a link on a website pointing to app
- Give the URL out to users
- User goes to website with a device and installs the app by tapping on link
Identify the UDID of the device
Open up iTunes, connect device, click on summary, click on serial number and the UDID will show up. Use the mouse to copy this. It is a long string.
Add the New Device to the Portal
Go to the developer.apple.com website and go to the provisioning profile. Click on Devices. Click on Add Device.
Add each device under the iOS provisioning portal
Add the UDID and Name
Paste the UDID that you copied from the device and type in a name. Do this for each device that you want to register.
Create a New Distribution profile
You can edit an existing profile and then add the devices to the existing profile, but for this process I’m going to create a new profile. Note that I’m using the distribution tab of the provisioning profile setup.
I’m assuming that your development environment has a valid certificate. If your development profile in the organizer is showing “valid signing identity not found” then go to the developer.apple.com website and follow the instructions for creating a valid certificate. You must create a certificate from the computer that you want to run or download from an existing on that has been setup. Note: Make sure that you only have one certificate in the keychain access.
Add a new profile.
Identify the devices for the profile
In the new profile, enter a name, the app ID, and then devices. These are the devices that you want to have access to your app. You only have 100 total devices per year per developer profile. Submit and the go to Xcode, and from the organizer synch and the profile will brought in.
Give name to archive and code sign
Click on the Scheme then click on edit the scheme, assign a name, push ok
Assign a name to your archive.
Go to the build settings, filter by code sign
Then Rebuild for Archive under the product menu. This will create an .ipa file.
Go to the Organizer/Archives click on the archive you created, click button DISTRIBUTE
Open Organizer to see the archives.
Click on Ad-Hoc Distribution
Choose on the distribution profile to include
Pick Distribution Profile
Save File
Create a simple website
Here is a simple website, with all contents that will enable a user to click a link.
Contents of your IPA app website.
Website Code
2 4 6 8 10 12 | <!DOCTYPE html PUBLIC'-//W3C//DTD XHTML 1.0 Transitional//EN''http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <head> <meta http-equiv='Content-Type'content='text/html; charset=utf-8'/> <ahref='itms-services://?action=download-manifest&url=<strong>http://192.168.1.123/nativeApp/manifest.plist</strong>'><font size='+4'>Install the App</font></a> </body> |
Plist File (use text wrangler to edit)
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 | <!DOCTYPE plist PUBLIC'-//Apple//DTD PLIST 1.0//EN''http://www.apple.com/DTDs/PropertyList-1.0.dtd'> <dict> <key>items</key> <dict> <key>assets</key> <!--software-package:the ipa toinstall.--> <!--required.the asset kind.--> <string>software-package</string> <!--required.the URL of the file todownload.--> <string><strong>http://192.168.1.123/nativeApp/TheElements.ipa</strong></string> </array><key>metadata</key> <!--required--> <string><strong>com.yourcompany.TheElements</strong></string> <key>kind</key> <!--required.the title todisplay during the download.--> <string>iOS Test App</string> </dict> </dict> |
Send out an email with url
http://192.168.1.123/nativeApp/index.html
If the user clicks on the link the app will be installed
Links
Ad-hoc Server Ppsspp Download
http://support.apple.com/kb/HT4061
http://mobiledevelopertips.com/xcode/distribute-ad-hoc-applications-over-the-air-ota.html
http://mobiledevelopertips.com/xcode/distribute-ad-hoc-applications-over-the-air-ota.html