Wednesday 20 December 2017

تتحرك من المتوسط - sql


أداء سكل سيرفر إو كل ما تحتاجه للنظر في أداء سكل سيرفر إو أمر حاسم للأداء العام. الوصول إلى البيانات على القرص هو أبطأ بكثير مما كانت عليه في الذاكرة، لذلك الحصول على أقصى استفادة من القرص المحلي و سان أمر ضروري. هناك الكثير من النصائح على شبكة الإنترنت وفي الكتب حول أداء سكل سيرفر إو، ولكن أنا لم تجد مصدر واحد سرد كل شيء للنظر فيها. هذه هي محاولتي لجمع كل المعلومات معا في مكان واحد. حتى هنا هو قائمة من كل شيء يمكن أن يخطر لك من أن يمكن أن تؤثر على أداء إو. لقد أمرت بدءا من الأقراص المادية ونقل ما يصل السلك إلى الملقم وأخيرا التعليمات البرمجية ومخطط قاعدة البيانات. فشل القرص عند فشل محرك أقراص في صفيف القرص سوف تحتاج إلى استبداله. يعتمد التأثير على الأداء قبل الاستبدال على مجموعة التخزين وتكوين ريد المستخدم. يستخدم ريد 5 و ريد 6 التكافؤ الموزع، ويستخدم هذا التكافؤ لحساب يقرأ عند فشل القرص. قراءة الأداء يفقد ميزة القراءة من أقراص متعددة. هذا صحيح أيضا، وإن كان بدرجة أقل، على صفائف ريد 1 (معكوسة). يقرأ فقدان ميزة القراءة من خطوط متعددة للبيانات على القرص الفاشل، ويكتب قد يكون أبطأ قليلا بسبب الزيادة في متوسط ​​الوقت السعي. كتابة ذاكرة التخزين المؤقت عند حدوث معاملة، يجب أن تكتمل الكتابة إلى سجل المعاملة قبل أن يتم وضع علامة على المعاملة على أنها ملتزمة. وهذا أمر ضروري لضمان سلامة المعاملات. كان يستخدم أن ذاكرة التخزين المؤقت للكتابة غير مستحسن، ولكن الكثير من أحدث مصفوفات تخزين مخابئ تدعمها البطارية معتمدة بالكامل للاستخدام مع سكل سيرفر. إذا كان لديك الخيار لتغيير توزيع الذاكرة بين ذاكرة التخزين المؤقت للقراءة والكتابة، حاول تخصيص أكبر قدر ممكن إلى ذاكرة التخزين المؤقت للكتابة. وذلك لأن سكل سيرفر يؤدي التخزين المؤقت للقراءة الخاصة بها عبر تجمع المخزن المؤقت، لذلك أي ذاكرة التخزين المؤقت قراءة إضافية على وحدة تحكم القرص لا فائدة. توفير رقيقة توفير رقيقة هو التكنولوجيا التي تقدمها بعض سانس حيث تخزين القرص الفعلي المستخدمة هو ما يكفي فقط للبيانات، في حين تظهر إلى الملقم أن تكون كاملة الحجم، مع الكثير من المساحة الحرة. حيث يتجاوز القرص الكلي المخصص لكل الملقمات مقدار التخزين الفعلي، وهذا يعرف باسم الإفراط في توفير. يحاول بعض موردي شبكة سان الادعاء بأن الأداء لا يتأثر، ولكن هذا ليس صحيحا دائما. رأيت هذه المشكلة مؤخرا على مجموعة 3PAR. وكانت قراءة متتابعة أبطأ بكثير على لونس رقيقة المقدمة. التبديل إلى لونس الموفرة سميكة أكثر من ضعف إنتاجية القراءة المتتابعة. أين هي الأقراص هي حيث كنت تعتقد أنها من الممكن تماما أن تكون متصلا مصفوفة التخزين، ولكن لطلبات إو لتمرير من خلال هذه المصفوفة إلى أخرى. ويتم ذلك في بعض الأحيان كوسيلة رخيصة لزيادة مساحة القرص - استخدام الأجهزة الموجودة التي يجري استخدامها بشكل أقل تكلفة أقل من شراء المزيد من الأقراص. والمشكلة هي أن هذا يدخل بعد عنصر آخر في المسار ويضر بالأداء - و دبا قد لا يكون حتى على بينة من ذلك. تأكد من معرفة كيفية تكوين سان. سمارت تيرينغ هذا ما يسمى أشياء مختلفة من قبل مختلف البائعين. تتكون مجموعة التخزين من نوعين أو أكثر من القرص، بأداء وتكلفة متفاوتتين. هناك أقراص 10K أبطأ - وهذه هي أرخص. ثم لديك أقراص 15K. هذه هي أسرع ولكن أكثر تكلفة. ومن ثم قد يكون هناك بعض محركات الأقراص الصلبة فائقة السرعة. هذه هي أكثر تكلفة، على الرغم من أن السعر ينخفض. يعمل الترحيل الذكي على ترحيل البيانات بين الطبقات بحيث تكون البيانات التي يتم الوصول إليها بشكل أكثر شيوعا في التخزين الأسرع بينما تنخفض البيانات الأقل شيوعا إلى التخزين البطيء. هذا هو موافق من حيث المبدأ، ولكن كنت دبا. يجب أن تعرف بالفعل البيانات التي تحتاج إلى الوصول إليها بسرعة والتي يمكن أن تكون أبطأ. هل تريد حقا خوارزمية اتخاذ هذا القرار بالنسبة لك ومهام الصيانة العادية يمكن الخلط بين كل شيء على أي حال. النظر في حمولة من إعادة بناء الفهرس تشغيل بين عشية وضحاها. دعونا نفترض أن قاعدة البيانات الأخيرة التي سيتم معالجتها هي قاعدة بيانات الأرشيف - هل تريد هذا هو أن يكون خنق سد عندما يقوم المستخدمون بتسجيل الدخول أول شيء في الصباح، في حين أن قاعدة البيانات المهمة مهمة يضعف أسفل في الطبقة السفلى هذا هو التبسيط، بالتاكيد. خوارزميات طبقات أكثر تطورا من ذلك، ولكن وجهة نظري تقف. يجب أن تقرر أولويات بيانات سكل سيرفر. لا تدع البائعين سان (أو المسؤولين التخزين) إقناع لك خلاف ذلك. النسخ المتماثل لمستوى التخزين هو النسخ المتماثل لمستوى التخزين هو ميزة استرداد بيانات الكوارث التي تقوم بنسخ بيانات مستوى كتلة من سان الأساسي إلى آخر - غالبا ما تقع في مركز بيانات منفصل. لا يدعي بائعو سان أي تأثير على الأداء، وهذا صحيح إذا تم تكوينه بشكل صحيح. ولكن لقد رأيت النسخ المتماثل تكوين سيئة لها تأثير خطير على الأداء. عانى عميل واحد من بضع سنوات من الأداء إو الفقراء. عندما انضممت إليهم تساءلت عما إذا كان النسخ المتماثل التخزين مسؤولا. قيل لي أن لا تكون سخيفة جدا - فحص البائع وأنها ليست المشكلة - يجب أن يكون سكل سيرفر نفسها بعد بضعة أشهر تم الاتصال بي مرة أخرى - أنها قد أوقفت النسخ المتماثل أثناء عملية الانتقال إلى جديد مركز البيانات وتخمين ما الكتابة الكمون تحسنت من قبل أمر من الحجم. واسمحوا لي أن أكرر أن هذا سببه سوء التكوين ومعظم التخزين تكرار لا يؤثر بشكل ملحوظ الأداء. ولكن شيء آخر للنظر إذا كنت تكافح مع أداء سكل سيرفر إو. محولات الحافلات المضيفة تحقق من أن البرامج الثابتة سان و هبا متوافقة. في بعض الأحيان عندما يتم ترقية سان، يتم تجاهل هباس على الملقمات. هذا يمكن أن يؤدي إلى أخطاء غير منتظمة، أو حتى جعل التخزين لا يمكن الوصول إليها. إلقاء نظرة على عمق قائمة انتظار هبا. الافتراضي الافتراضي هو 32، والتي قد لا تكون الأمثل. وقد أظهرت بعض الدراسات أن زيادة هذا إلى 64 أو أعلى يمكن أن تحسن الأداء. ويمكن أيضا أن تجعل الأمور أسوأ، اعتمادا على عبء العمل، سان جعل ونموذج، تخطيط القرص، وما إلى ذلك حتى اختبار بدقة إذا كنت تستطيع. بعض المشرفين التخزين يثبطون تعديل عمق قائمة الانتظار هبا لأنها تعتقد أن الجميع سوف تريد نفسه على ملقماتهم وسيتم تخزين مجموعة التخزين. وهذا الحق، أيضا إقناع لهم أنه هو فقط لأجلك. وعد بعدم إخبار أي شخص آخر. ايا كان. مجرد الحصول على عمق طابور اضافية إذا كنت تعتقد أنها سوف تستفيد الأداء. عدد كبير جدا من الخوادم عندما تقوم شركة بتشغيل ثروة صغيرة على شبكة منطقة تخزين، فإنها تريد الحصول على قيمة مقابل المال. لذلك بطبيعة الحال، كل ملقم جديد يأتي يأتي على طول مدمن مخدرات حتى تتمكن من الاستفادة من كل هذا الفضاء القرص جميل. هذا على ما يرام حتى بضعة خوادم تبدأ إصدار الكثير من طلبات إو والمستخدمين الآخرين يشكون من تباطؤ الأداء. هذا شيء أراه مرارا وتكرارا في العديد من العملاء، وليس هناك حل سهل. الشركة لا تريد أو غير قادر على شراء سان آخر. إذا كنت تعتقد أن هذا هو مشكلة بالنسبة لك، ووضع جدول زمني معا من جميع الوظائف - عبر جميع الخوادم - ومحاولة إعادة جدولة بعض بحيث يتم توزيع عبء العمل بشكل أكثر توازنا. التقسيم والتنسيق محاذاة سأذكر بإيجاز محاذاة التقسيم، على الرغم من أن ويندوز 2008 يستخدم إزاحة افتراضية تبلغ 1 ميغا بايت، ولذلك فإن هذه المشكلة أقل مما كانت عليه. وأنا أيضا غير مقتنع بأن الكثير من سانز الحديثة تستفيد كثيرا من هذه الممارسة. أجريت اختبارا على إيفا قبل بضع سنوات، ووجدت مجرد تحسن 2. ومع ذلك، فإن نسبة قليلة لا تزال تستحق السعي ل. لسوء الحظ سيكون لديك لتدمير وحدات التخزين الخاصة بك وإعادة أقسام الخاص بك إذا كان هذا هو أن تكون ثابتة على نظام موجود. هذا هو على الارجح لا يستحق الازعاج إلا إذا كنت تسعى لكل شبر من الأداء الأخير. التنسيق هو شيء آخر يجب أن يتم بشكل صحيح. يخزن سكل سيرفر البيانات في صفحات 8KB، ولكن يتم استرداد هذه في كتل من 8، ودعا المسافات. إذا تم تنسيق الأقراص مع وحدات تخصيص 64KB، وهذا يمكن أن يكون لها فائدة كبيرة الأداء. مولتيباثينغ إذا كنت لا تستخدم القرص المحلي ثم يجب أن يكون لديك بعض التكرار المدمج في النظام الفرعي التخزين الخاص بك. إذا كان لديك سان لديك شبكة معقدة من هباس والنسيج والمفاتيح وأجهزة التحكم بين سكل سيرفر والأقراص. يجب أن يكون هناك اثنين على الأقل من هبا، والمفاتيح، وما إلى ذلك، وينبغي أن تكون كلها مرتبطة معا في مثل هذه الطريقة أن هناك مسارات متعددة إلى الأقراص. هذا التكرار هو في المقام الأول لتوافر عالية، ولكن إذا تم تكوين تعدد المسارات كما نشط نشط قد ترى فوائد الأداء كذلك. شبكة التخزين المرفقة منذ سكل سيرفر 2008 R2 كان من الممكن إنشاء أو استعادة أو إرفاق قاعدة بيانات على مشاركة ملف. هذا لديه عدد من الاستخدامات الممكنة، وخاصة لبيئات ديفيست فإنه يمكن أن تجعل إدارة القدرات أسهل، وجعل قواعد البيانات تتحرك بين خوادم أسرع بكثير. السؤال الذي يجب طرحه، على الرغم من ذلك، هو كوتيدو كنت حقا تريد هذا في برودكتيونكوت الأداء لن تكون جيدة مثل محركات الأقراص المحلية أو سان. هناك مكونات إضافية في السلسلة، لذلك قد لا تكون الموثوقية جيدة. وباستخدام الشبكة، تستخدم بياناتك البنية التحتية نفسها مثل كل حركة مرور تكبيب الأخرى، مما قد يؤثر مرة أخرى على الأداء. ولكن ثيريس الخبر السار بينما توفر لا يزال مصدر قلق، وتحسينات في سمب على ويندوز سيرفر 2012 (وعبر تحديث ل ويندوز سيرفر 2008 R2) جعلت بشكل أسرع بكثير. رأيت اقتباس من موظف ميكروسوفت في مكان ما ادعى 97 من أداء التخزين المحلي. لا أستطيع العثور على الاقتباس الآن، وأنا لا أتذكر إذا كان قياس الكمون أو الإنتاجية. تجزئة القرص كم عدد المرات التي تستخدم فيها أداة إلغاء تجزئة القرص على جهاز الكمبيوتر الخاص بك لتحليل و إلغاء تجزئة C: دريف عدد المرات التي تقوم فيها بالتحقق من التجزؤ على الأقراص الموجودة على خوادم سكل بالنسبة لمعظم الناس الذين ليس لديهم أي مكان قريب، ومع ذلك تجزئة حجم هو تماما كما يضر أداء سكل سيرفر كما هو الحال على جهاز الكمبيوتر الخاص بك. يمكنك تقليل احتمال تجزؤ القرص بعدد من الطرق: بيانات ما قبل الحجم وملفات السجل بدلا من الاعتماد على النمو التلقائي تعيين الزيادات في النمو التلقائي إلى قيم معقولة بدلا من الافتراضي 10 تجنب تقلص البيانات وملفات السجل أبدا، استخدام قاعدة بيانات أوتوشرينك الخيار ضمان أقراص مخصصة ل سكل سيرفر وعدم مشاركتها مع تطبيقات أخرى يمكنك التحقق من تجزؤ باستخدام نفس الأداة كما على جهاز الكمبيوتر الخاص بك. يتوفر إلغاء تجزئة القرص على كافة إصدارات خادم ويندوز. وهناك طريقة أخرى للتحقق من خلال فئة Win32Volume في ومي. هذا بت من بويرشيل تقارير تجزئة الملف في المئة لكافة وحدات التخزين على ملقم معين. إذا كان لديك تجزؤ كبير هناك بضع طرق لإصلاحه. الخيار المفضل هو كما يلي، ولكن يتطلب بعض التوقف. إيقاف خدمات سكل النسخ الاحتياطي للملفات على القرص (خاصة ملفات مدف و ندف و لدف - أفضل آمنة من آسف) تشغيل أداة إلغاء تجزئة القرص ويندوز بدء تشغيل خدمات سكل تحقق من سجل الأخطاء للتأكد من عدم وجود أخطاء أثناء بدء التشغيل تشغيل تشيكدب ضد كافة قواعد البيانات باستثناء تمبدب). إيف لم أر أداة ديفراغ سبب الفساد، ولكن لا يمكن أن تكون حذرا جدا خيار آخر لا يتطلب التوقف هو استخدام أداة طرف ثالث مثل ديسكيبر. هذا يمكن أن تكون فعالة جدا في تحديد ومنع تجزئة القرص، ولكن يكلف المال ويستخدم برنامج تشغيل عامل تصفية - انظر تعليقاتي أدناه. برامج تصفية عامل تصفية برنامج تشغيل عامل تصفية هو جزء من البرنامج الذي يجلس بين طلب إو والكتابة إلى القرص. وهو يسمح للكتاب أن يتم فحص ورفض أو تعديلها أو تدقيقها. يتم تثبيت النوع الأكثر شيوعا من برنامج تشغيل عامل التصفية بواسطة برنامج مكافحة الفيروسات. أنت لا تريد برنامج مكافحة الفيروسات فحص كل الكتابة واحدة إلى ملفات قاعدة البيانات الخاصة بك. أنت أيضا لا تريد التحقق من النسخ الاحتياطية الخاصة بك إما، أو يكتب إلى سجل الأخطاء، أو التتبع الافتراضي. إذا كان لديك برنامج أف مثبت، يمكنك تحديد الاستبعادات. استبعاد كافة المجلدات المستخدمة بواسطة سكل سيرفر، بالإضافة إلى محركات الأقراص المستخدمة من قبل البيانات وملفات السجل، بالإضافة إلى المجلدات المستخدمة للنسخ الاحتياطية. حتى أفضل هو إيقاف التدقيق عبر الإنترنت أف، وجدولة المسح الضوئي في وقت هادئ. أولتب و بي على نفس الخادم من النادر العثور على النظام الذي هو أولتب بحتة. ومعظمها سيكون نوعا من عنصر الإبلاغ أيضا. وللأسف، فإن نوعي عبء العمل لا يتعايشان دائما بسعادة. إيف كان يقرأ الكثير من المقالات التي كتبها جو تشانغ، وفي مقال واحد يشرح لماذا هذا هو الحال. أساسا، خطط الاستعلام أولتب استرداد الصفوف في دفعات صغيرة (أقل من عتبة 25 الصفوف) ويتم التعامل مع هذه الطلبات إو بشكل متزامن من قبل مشغل قاعدة البيانات، وهذا يعني أنها تنتظر البيانات لاسترجاعها قبل الاستمرار. أعباء العمل الكبيرة بي والاستعلامات التقارير، في كثير من الأحيان مع خطط موازية، وإصدار طلبات إو غير متزامن والاستفادة الكاملة من قدرة هبا لطلبات الانتظار. ونتيجة لذلك، يجب على طلبات أولتب الانتظار في انتظار طلبات بي، مما يؤدي إلى انخفاض أداء أولتب بشكل كبير. التنمو التلقائي وتهيئة الملف الفوري من الجيد أن يكون النمو التلقائي ممكنا، تماما كاجراء وقائي، على الرغم من أنه يجب عليك أيضا حجم البيانات وتسجيل الملفات مسبقا بحيث نادرا ما تحتاج إليها. ومع ذلك، ماذا يحدث إذا كان ملف البيانات ينمو وليس لديك التهيئة الفورية ملف تمكين خاصة إذا تم تعيين لصناعة السيارات في النمو كبيرة جدا. كل إو ضد الملف يجب أن تنتظر لنمو الملف لإكمال، وهذا قد يتم الإبلاغ عنها في المقاطع الشائنة اتخذت أطول من 15 ثانية إلى كومبليتكوت رسالة في سجل الأخطاء. التهيئة الفورية لن تساعد مع نمو السجل، لذلك تأكد من الزيادات سجل النمو التلقائي ليست مرتفعة جدا. لمزيد من المعلومات حول تهيئة ملف الفورية وكيفية تمكينه، راجع هذا الرابط تهيئة ملف قاعدة البيانات. وبينما في موضوع لصناعة السيارات في النمو، انظر قسم على التعبئة النسبية، أدناه. أداء سجل المعاملات المدة التي يستغرقها سجل معاملاتك أقل من 1 مللي ثانية أكثر من 5ms انظر إلى إحصائيات الملفات الظاهرية أو عدادات الأداء أو وقت الانتظار وريتلوغ لمعرفة ما إذا كان وقت كتابة السجل يمثل مشكلة لك. يكتب إلى سجل المعاملات متسلسلة، وبالتالي فإن رأس الكتابة على القرص يجب أن يكون مثاليا حيث كان من آخر سجل الكتابة. وهذا يعني عدم التماس الوقت، وأوقات الكتابة بسرعة حارقة. وبما أن الصفقة لا يمكن أن تلتزم حتى سجل تصلب إلى القرص، كنت تعتمد على هذه يكتب بسرعة لنظام بيرفورمانت. وكانت المشورة لسنوات لسجل المعاملات لكل قاعدة بيانات لتكون على القرص الخاص بها. وهذه النصيحة لا تزال جيدة للقرص المحلي، وبالنسبة لبعض صفائف التخزين. ولكن الآن أن الكثير من سانس لديها ذاكرة التخزين المؤقت الكتابة المدعومة البطارية، هذه النصيحة ليست حاسمة كما كان عليه الحال. شريطة أن ذاكرة التخزين المؤقت كبيرة بما فيه الكفاية للتعامل مع رشقات نارية الذروة من النشاط الكتابة (ونرى تعليقاتي السابقة حول تخصيص المزيد من ذاكرة التخزين المؤقت لكتابة من يقرأ) سوف تحصل على الكمون المنخفض جدا. لذلك ماذا لو لم يكن لديك ترف ضخم باكز سان والأحمال من ذاكرة التخزين المؤقت الكتابة ثم المشورة التي كانت موجودة منذ 1990s لا تزال صالحة: ملف سجل المعاملات واحد لكل قاعدة بيانات على محرك الأقراص الخاصة بها ريد 1، ريد 10 أو ريد 01 لذلك على افتراض كنت سعيدا مع تخطيط ملف السجل الخاص بك، ماذا يمكن أن يتباطأ السجل الخاص بك يكتب ملفات السجل الظاهري على الرغم من أن سجل المعاملات مكتوب بالتتابع، الملف نفسه يمكن أن تصبح مجزأة داخليا. عندما يتم إنشاؤه لأول مرة يتكون من عدة قطع تسمى ملفات السجل الظاهري. في كل مرة يتم زراعتها، سواء يدويا أو تلقائيا، يتم إضافة عدة ملفات سجل افتراضية أخرى. سجل المعاملات الذي ينمو عدة مرات يمكن أن ينتهي مع الآلاف من ملفات السجل الظاهري. وجود عدد كبير جدا من فلف يمكن أن يؤدي إلى إبطاء التسجيل وقد يؤدي أيضا إلى إبطاء النسخ الاحتياطي لوغ. تحتاج أيضا إلى توخي الحذر لتجنب فلفس التي هي كبيرة جدا. لا يتم مسح ملف سجل ظاهري غير نشط حتى يتم الوصول إلى نهاية ويبدأ واحد المقبل لاستخدامها. للحصول على نموذج الانتعاش الكامل، وهذا لا يحدث حتى النسخ الاحتياطي سجل المقبل. لذلك النسخ الاحتياطي سجل سوف يكون فجأة الكثير من العمل ل، وقد يسبب مشاكل في الأداء في حين أنه يأخذ مكان. الجواب عن سجل معاملات كبير هو تعيين حجم الأولي الأقصى 8000MB، ثم تنمو يدويا في قطع من 8000MB حتى حجم الهدف. وهذا يؤدي إلى أقصى حجم فلف يبلغ 512 ميغابايت، دون إنشاء عدد كبير جدا من فلف. ملاحظة: هذه النصيحة هي للنمو اليدوي فقط. لا تنمو السيارات بنسبة 8000MB سوف تتوقف جميع المعاملات في قاعدة البيانات في حين يتم تهيئة مساحة إضافية. أوتوغرو ينبغي أن يكون أصغر من ذلك بكثير - ولكن محاولة يدويا حجم الملف بحيث السيارات من غير المرجح أن تكون هناك حاجة إليها. حدود مدير السجل يضع محرك قاعدة البيانات حدودا على كمية السجل التي يمكن أن تكون في حالة طيران في أي وقت واحد. هذا هو حد لكل قاعدة بيانات، ويعتمد على إصدار سكل سيرفر قيد الاستخدام. سكل سيرفر يحد من عدد إوس المعلقة و ميغابايت في الثانية. تختلف الحدود مع الإصدار وما إذا كان 32 بت أو 64 بت. راجع تشخيص مشكلات أداء سجل المعاملة وحدود مدير السجل للحصول على مزيد من التفاصيل. هذا هو السبب في أن الكمون الكتابة يجب أن تكون منخفضة قدر الإمكان. إذا كان يستغرق 20ms الكتابة إلى سجل المعاملات، وكنت تقتصر على 32 إوس في رحلة في وقت واحد، وهذا يعني بحد أقصى 1600 المعاملات في الثانية الواحدة، أقل بكثير ما يتطلب الكثير من قواعد البيانات أولتب حجم كبير. وهذا يؤكد أيضا على أهمية إبقاء حجم المعاملات صغيرا، حيث يمكن أن تؤدي معاملة واحدة كبيرة جدا إلى تصريف المعاملات الأخرى في حين أنها تلتزم. إذا كنت تعتقد أن هذه الحدود تؤثر على أداء الكتابة سجل في قواعد البيانات الخاصة بك هناك عدة طرق لمعالجة المشكلة: العمل على زيادة أداء الكتابة سجل إذا كان لديك عمليات تسجيل الحد الأدنى يمكنك التبديل قاعدة البيانات لاستخدام نموذج استرداد لوغ بولك. على الرغم من الحذر - يجب أن يتم استعادة النسخ الاحتياطي سجل يحتوي على عملية تسجيل الحد الأدنى بالكامل. نقطة في استعادة الوقت غير ممكن. تقسيم قاعدة بيانات عالية الحجم إلى 2 أو أكثر من قواعد البيانات، حيث يتم تطبيق حدود السجل لكل قاعدة بيانات نشاط السجل غير المتسلسل هناك إجراءات يقوم بها مشغل قاعدة البيانات التي تتحرك رأس الكتابة بعيدا عن نهاية ملف السجل. إذا كانت المعاملات لا تزال ملتزمة في حين يحدث هذا، لديك تسعى النفقات العامة وتسجيل الأداء يزداد سوءا. العمليات التي تقرأ من ملفات السجل تتضمن التراجع عن المعاملات الكبيرة، النسخ الاحتياطي سجل النسخ المتماثل (وكيل قارئ السجل). هناك القليل يمكنك القيام به حول معظم هذه، ولكن تجنب رولباكس كبيرة هو الشيء الذي ينبغي معالجتها في مرحلة التصميم والتطوير للتطبيق. التناسب التعبئة يمكن وضع جداول نشطة جدا في مجموعة ملفات تحتوي على ملفات بيانات متعددة. هذا يمكن أن تحسن أداء القراءة إذا كانت على أقراص فعلية مختلفة، ويمكن أن تحسن أداء الكتابة عن طريق الحد من خلاف في صفحات التخصيص (وخاصة صحيح ل تيمبدب). تفقد بعض الفائدة، على الرغم من ذلك، إذا كنت لا تستفيد من خوارزمية التعبئة النسبي. التعبئة النسبية هي العملية التي تحاول قاعدة البيانات تخصيص صفحات جديدة بما يتناسب مع مقدار المساحة الحرة في كل ملف بيانات في مجموعة الملفات. للحصول على أقصى فائدة تأكد من أن كل ملف هو نفس الحجم، وينمو دائما بنفس الزيادة. هذا هو لكلا اليدوي ونمو السيارات. شيء واحد أن يكون على بينة من كيف يعمل نمو السيارات. سكل سيرفر يبذل قصارى جهده لملء الملفات بنفس المعدل، ولكن واحد سوف تملأ دائما قبل الآخرين، وهذا الملف ثم السيارات تنمو من تلقاء نفسها. ثم يحصل على مزيد من تخصيصات الصفحة الجديدة من الآخرين ويصبح نقطة ساخنة مؤقتة حتى الآخرين أيضا السيارات تنمو واللحاق. هذا من غير المحتمل أن يسبب مشاكل لمعظم قواعد البيانات، على الرغم من أن تمبدب قد يكون أكثر وضوحا. تتبع العلامة 1117 يؤدي جميع ملفات البيانات في مجموعة ملفات إلى النمو معا، لذلك يستحق النظر إذا كان هذا هو مشكلة بالنسبة لك. شخصيا أود بدلا يدويا حجم الملفات بحيث نمو السيارات ليس من الضروري. تيمبدب التكوين يتيح البدء مع بعض الأشياء التي يوافق الجميع على: ملفات تيمبدب يجب أن توضع على أسرع التخزين المتاحة. سد المحلية مثالية، ومن سكل سيرفر 2012 هذا ممكن حتى على كتلة ما قبل حجم البيانات وملفات السجل، حيث أن نمو السيارات قد يسبب مشاكل في الأداء بينما يحدث يتم إنشاء كائنات مؤقتة جديدة في كل وقت، لذلك الخلاف في غام ، سغام وصفحات بس قد تكون مشكلة في بعض البيئات والآن بعض الاختلافات في الرأي: هناك الكثير من النصائح في جميع أنحاء شبكة الإنترنت لإنشاء ملف بيانات تيمبدب واحد لكل الأساسية للحد من تخصيص الخلاف. بول راندال لا يوافق (أسطورة سكل سيرفر دبا في اليوم: (1230) تيمبدب يجب أن يكون دائما ملف بيانات واحد لكل النواة الأساسية). ويقول أن الكثير من الملفات يمكن أن تجعل الأمور في الواقع أسوأ. حله هو إنشاء ملفات أقل وزيادة فقط إذا لزم الأمر هناك المزيد من النصائح، وغالبا ما تتكرر، لفصل ملفات تمبدب من قواعد البيانات الأخرى ووضعها على المغزل المادية الخاصة بهم. جو تشانغ غير موافق ولديه حجة جيدة جدا لاستخدام مجموعة مشتركة من الأقراص. (البيانات، سجل و تيمب ملف التنسيب). إل ترك لك أن تقرر ما يجب القيام به أوتوشرينك كان خيار قاعدة بيانات أوتوشرينك حول أي وقت مضى منذ بدأت باستخدام سكل سيرفر، مما تسبب في الكثير من مشاكل الأداء للأشخاص الذين مكنوا من دون تحقيق تماما ما يفعله. في كثير من الأحيان تطبيق طرف ثالث سيتم تثبيت قاعدة بيانات مع تمكين هذا الخيار، و دبا قد لا تلاحظ ذلك حتى وقت لاحق. فلماذا هو سيء اثنين من الأسباب: يتم استخدامه دائما بالتزامن مع السيارات تنمو، ودورة مستمرة من النمو يتقلص تنمو يسبب قدرا كبيرا من تجزئة القرص المادي. إيف غطت بالفعل هذا الموضوع في وقت سابق في هذه المقالة في حين أنه يؤدي يتقلص هناك الكثير من إو إضافية، مما يبطئ النظام لكل شيء آخر تعطيله. تخصيص مساحة كافية للبيانات وتسجيل الملفات، وحجمها وفقا لذلك. و لا تنسى أن إصلاح كل هذا التشرذم بينما كنت في ذلك. الذاكرة غير كافية هذه مقالة حول أداء سكل سيرفر إو، وليس الذاكرة. لذلك أنا لا أريد أن تغطيه في أي تفصيل هنا - وهذا هو موضوع لمقال مختلف. أريد فقط أن أذكركم بأن سكل سيرفر يحب الذاكرة - كلما كان ذلك أفضل. إذا قاعدة البيانات الخاصة بك كامل (ق) يناسب الذاكرة سيكون لديك نظام أسرع بكثير، وتجاوز كل ذلك إو بطيئة. يمكن أن يؤدي عدم وجود الذاكرة إلى مسح الصفحات القذرة إلى القرص في كثير من الأحيان لجعل مساحة لمزيد من الصفحات التي تقرأ. عدم وجود الذاكرة يمكن أن يؤدي أيضا إلى زيادة تمبدب إو، والمزيد من وركتابلز لعمليات الفرز والتجزئة لديها لتخزين التخزين المؤقت على القرص. على أي حال، وجهة هذا القسم هو حقا لجعل بيان واحد: ملء الخوادم الخاصة بك مع أكبر قدر من الذاكرة كما يمكنك تحمله، وكما أن الطبعة من سكل سيرفر و ويندوز يمكن معالجة. يحتوي سكل سيرفر 2014 على ميزة جديدة السماح ببعض الجداول ليتم الاحتفاظ بها في الذاكرة، والوصول إليها عن طريق تجميع الإجراءات المخزنة أصلا. قد تكون هناك حاجة إلى بعض إعادة تصميم بعض من التعليمات البرمجية الموجودة لديك للاستفادة من هذا، ولكن يبدو وكأنه دفعة أداء كبيرة لتلك الأنظمة أولتب التي تبدأ في استخدامها. ارتفاع استخدام تمبدب تمبدب يمكن أن يكون المستهلك الرئيسي من إو وقد تؤثر على الأداء العام إذا ما استخدمت بشكل مفرط. ومن المفيد النظر في الأسباب المختلفة لاستخدامها، وفحص النظام الخاص بك لضمان كنت قد التقليل من هذه إلى أقصى حد ممكن. الكائنات المؤقتة التي أنشأها المستخدم أكثرها شيوعا هي الجداول المؤقتة ومتغيرات الجدول والمؤشرات. إذا كان هناك نسبة عالية من الخلق وهذا يمكن أن يؤدي إلى خلاف الصفحة تخصيص، على الرغم من أن زيادة عدد ملفات البيانات تيمبدب قد يخفف جزئيا هذا. عمليات إنشاء جداول مؤقتة كبيرة جدا أو متغيرات الجدول هي كبيرة لا لا، لأنها يمكن أن تسبب الكثير من إو. الكائنات الداخلية يقوم مشغل قاعدة البيانات بإنشاء جداول عمل في تمبدب للتعامل مع تجزئة الارتباطات، فرز وتخزين مجموعات النتائج المتوسطة. عندما تحتاج عمليات التصنيف أو ارتباطات التجزئة إلى ذاكرة أكثر مما تم منحها، فإنها تنتقل إلى القرص (باستخدام تيمبدب) وسترى تحذيرات تجزئة وتحذيرات فرز في التتبع الافتراضي. كتبت في الأصل بضع فقرات حول كيف ولماذا يحدث وماذا يمكنك القيام به لمنع ذلك، ولكن بعد ذلك وجدت هذه الوظيفة التي يفسر ذلك أفضل بكثير - فهم هاش، فرز وتبادل الأحداث تسرب. الإصدار مخزن الاستخدام الثالث من تمبدب هو مخزن الإصدار. يستخدم هذا للإصدار الصف. يتم إنشاء إصدارات الصف عندما يتم استخدام عزل لقطة أو قراءة لقطة لقطة ملتزمة. يتم إنشاؤها أيضا خلال إعادة بناء الفهرس على الانترنت للحصول على التحديثات والحذف الذي تم إجراؤه أثناء إعادة بناء ومعالجة تعديلات البيانات إلى مجموعات نتائج نشطة متعددة (مارس). تطبيق ضعيف الكتابة (أو المستخدم المارقة) إجراء تحديث كبير يؤثر على العديد من الآلاف من الصفوف عند استخدام مستوى عزل استنادا إلى الصف قيد الاستخدام قد يسبب نموا سريعا في تمبدب ويؤثر سلبا على أداء إو للمستخدمين الآخرين. جدول وفهرس المسح الضوئي مسح الجدول هو مسح كومة الذاكرة المؤقتة. مسح الفهرس هو مسح مؤشر متفاوت المسافات أو غير متفاوت المسافات. قد يكون كلاهما الخيار الأفضل إذا لم يكن هناك مؤشر تغطية، ومن المرجح أن يتم استرجاع الكثير من الصفوف. مسح مؤشر متفاوت المسافات يؤدي أفضل من مسح الجدول - وهناك سبب آخر لتجنب أكوام ولكن ما الذي يسبب المسح الضوئي لاستخدامها في المقام الأول، وكيف يمكنك جعل تسعى على الأرجح الإحصاءات من التاريخ قبل التحقق من الفهارس والرمز، وجعل تأكد من أن الإحصاءات محدثة. تمكين كوتوتو إنشاء إحصائيات. إذا لم يتم تمكين كوتوتو تحديث إحصائية تأكد من تشغيل تحديث الإحصاءات يدويا بانتظام. هذه فكرة جيدة حتى لو تم تمكين كوتوتو أوبديت ستاتيستيكوت، حيث أن عتبة ما يقرب من 20 من الصفوف التي تم تغييرها قبل بدء التحديث التلقائي في كثير من الأحيان لا تكفي، وخصوصا حيث يتم إضافة صفوف جديدة مع مفتاح تصاعدي. اختيار الفهرس في بعض الأحيان لا يتم استخدام فهرس موجود. إلقاء نظرة على تحسين الانتقائية، ربما عن طريق إضافة أعمدة إضافية، أو تعديل ترتيب العمود. النظر في ما إذا كان يمكن إنشاء مؤشر تغطية. ومن المرجح أن يتم تنفيذ طلب البحث إذا لم تكن هناك حاجة إلى البحث المرجعية. انظر هذه المشاركات على نقطة كوتينغ بواسطة كيمبرلي تريب. نقطة التحول . غير فعالة تسكل الطريقة التي يتم بها كتابة استعلام يمكن أن يؤدي أيضا إلى مسح، حتى إذا كان فهرس مفيد موجود. بعض أسباب ذلك هي: عبارات غير سارجابل في جملة وير. كوتسارجكوت يعني أرجومنت بسيطة. لذلك نقل الحسابات بعيدا عن الأعمدة وعلى الثوابت بدلا من ذلك. على سبيل المثال، هذا لن يستخدم الفهرس على أوردرديت: وير ديتاد (داي 1. أوردرديت) غ جيتديت () حيث أن هذا سوف يستخدم فهرس إذا كان موجودا (وأنه انتقائي بما فيه الكفاية): وير أوردرديت غ ديتاد (داي. - 1. جيتديت ()) قد تؤدي التحويلات الضمنية في استعلام أيضا إلى إجراء فحص. انظر هذه المشاركة بواسطة جوناثان كيهاياس التحويلات الضمنية التي تسبب فهرس الفهرس. معلمة سيئة استنشاق المعلمة استنشاق هو شيء جيد. انها تسمح خطة إعادة استخدام ويحسن الأداء. ولكن أحيانا يؤدي إلى خطة تنفيذ أقل كفاءة لبعض المعلمات. صيانة الفهرس يجب الحفاظ على كل فهرس. إم لا نتحدث عن خطط الصيانة، ولكن حول حقيقة أنه عند إدراج الصفوف، حذفها وتحديثها، يجب أيضا تغيير الفهارس غير المتفاوتة. وهذا يعني إو إضافية لكل مؤشر على جدول. لذلك فمن الخطأ أن يكون أكثر فهارس مما تحتاج إليه. تحقق من استخدام جميع الفهارس. تحقق من التكرارات والفهارس الزائدة (حيث تكون الأعمدة في واحد مجموعة فرعية من الأعمدة في آخر). تحقق من وجود فهارس حيث يكون العمود الأول متطابقا ولكن الباقي ليس كذلك - أحيانا يمكن دمجها. وبالطبع، اختبار، اختبار، اختبار. يؤثر تجزؤ فهرسة الفهرس على أداء إو بعدة طرق. مجموعة المسح الضوئي هي أقل كفاءة، وأقل قدرة على الاستفادة من القراءة المقبلة يقرأ الفضاء الفارغ التي تم إنشاؤها في صفحات يقلل من كثافة البيانات، وهذا يعني أكثر قراءة إو ضروري التشرذم نفسه سببه انشقاقات الصفحة، وهو ما يعني المزيد من الكتابة إو هناك عدد من الأشياء التي يمكن القيام بها للحد من تأثير التجزؤ، أو لتقليل كمية التجزؤ. إعادة إنشاء الفهارس أو إعادة تنظيمها بشكل منتظم حدد عامل تعبئة أقل بحيث تحدث انقسامات الصفحات أقل كثيرا (وإن لم تكن منخفضة جدا، انظر أدناه) غير الفهرس المتفاوت المسافات لاستخدام مفتاح تصاعدي بحيث يتم إلحاق الصفوف الجديدة حتى النهاية، بدلا من إدراجها في مكان عشوائي في منتصف السجلات الموجهة عندما يتم تحديث صف في كومة الذاكرة المؤقتة ويتطلب مساحة أكبر، يتم نسخه إلى صفحة جديدة. ولكن لا يتم تحديث الفهارس غير متفاوت المسافات للإشارة إلى الصفحة الجديدة. بدلا من ذلك، تتم إضافة مؤشر إلى الصفحة الأصلية لإظهار المكان الذي تم نقل الصف إليه. وهذا ما يسمى مؤشر إعادة توجيه، وهناك احتمال أن يكون هناك سلسلة طويلة من هذه المؤشرات لاجتياز للعثور على البيانات النهائية. وبطبيعة الحال، وهذا يعني المزيد من إو. كومة الذاكرة المؤقتة لا يمكن تجزئة عن طريق إعادة بناء المؤشر (لا يوجد واحد). الطريقة الوحيدة للقيام بذلك هي إنشاء فهرس متفاوت المسافات في كومة الذاكرة المؤقتة، ثم إسقاطه بعد ذلك. كن على علم بأن هذا سيؤدي إلى إعادة بناء كافة الفهارس غير متفاوت المسافات مرتين - مرة واحدة الفهرس متفاوت المسافات جديد، ومرة ​​أخرى عندما يتم إسقاطه. إذا كان هناك الكثير من هذه فكرة جيدة لإسقاط الفهارس غير متفاوتة أولا، وإعادة إنشائها بعد ذلك. والأفضل من ذلك هو تجنب أكوام حيثما أمكن. أوافق على أنه قد تكون هناك حالات يكون فيها الخيار الأكثر كفاءة (إدراجها في جداول الأرشفة، على سبيل المثال)، ولكن دائما ما إذا كان الفهرس المتفاوت المسافات سيكون خيارا أفضل - فهو عادة ما يكون. الفضاء الضائع في عالم مثالي كل صفحة بيانات على القرص (وفي الذاكرة) سيكون 100 كامل. وهذا يعني أن الحد الأدنى من إو مطلوب لقراءة وكتابة البيانات. في الممارسة العملية، هناك مساحة مهدرة في جميع الصفحات تقريبا - في بعض الأحيان نسبة عالية جدا - وهناك الكثير من الأسباب لماذا يحدث هذا. انخفاض عامل التعبئة إيف ذكر عامل التعبئة بالفعل. إذا كانت عالية جدا، وتقسيم الصفحات تحدث عند إدراج الصفوف أو تحديثها، فمن المعقول إعادة بناء الفهرس مع عامل تعبئة أقل. ومع ذلك، إذا كان عامل التعبئة منخفض جدا قد يكون لديك الكثير من المساحة الضائعة في صفحات قاعدة البيانات، مما أدى إلى المزيد من إو واستخدام الذاكرة. هذا هو واحد من تلك كوتسوك و سينكوت سينكاريوت. في بعض الأحيان هناك حاجة إلى حل توفيقي. تقسيمات الصفحة يتم أيضا مناقشة ذلك أعلاه. ولكن، فضلا عن التجزئة، يمكن تقسيم الصفحات أيضا أن يؤدي إلى مساحة ضائعة إذا لم يتم إعادة استخدام مساحة فارغة. والحل هو إلغاء التجزئة عن طريق إعادة بناء أو إعادة تنظيم الفهارس بانتظام. الاختيار المفرط لأنواع البيانات استخدم أصغر أنواع البيانات التي يمكنك. وحاول تجنب داتاتيبيس طول ثابت، مثل شار (255)، إلا إذا كنت تحديث بانتظام إلى أطول طول وتريد تجنب تقسيمات الصفحة. المنطق بسيط. إذا كنت تستخدم فقط 20 حرفا من 200، وهذا هو 90 الفضاء الضائع، وأكثر إو نتيجة لذلك. كلما زادت كثافة البيانات في الصفحة كلما كان ذلك أفضل. التفكير كسول قد تجعل المطورين إنشاء العنوانLine1، العنوانLine2، الخ كما شار (255)، لأنها لا تعرف في الواقع ما يجب أن يكون أطول. في هذه الحالة، إما القيام ببعض البحوث، ومعرفة أن أطول هو 50 حرفا (على سبيل المثال) وتقليلها إلى شار (50)، أو استخدام نوع بيانات طول متغير. مخطط التصميم إيف ذكر بالفعل اختيار أنواع البيانات أعلاه، ولكن هناك قرارات التصميم المخطط الأخرى التي يمكن أن تؤثر على كمية إو التي تم إنشاؤها بواسطة قاعدة بيانات التطبيق. الأكثر شيوعا هو تصميم الجداول التي هي واسعة جدا. أرى أحيانا جدولا مع 20، 30، 50، حتى 100 عمود. This means fewer rows fit on a page, and for some extreme cases there is room for just one row per page - and often a lot of wasted space as well (if the row is just slightly wider than half a page, thats 50 wasted). If you really do need 50 columns for your Customer table, ask yourself how many of these are regularly accessed. An alternative is to split into 2 tables. Customer, with just a few of the commonly used columns, and CustomerDetail with the rest. Of course, the choice of which columns to move is important. You dont want to start joining the tables for every query as that defeats the object of the exercise. Page or Row Compression Compression is another way of compacting the data onto a page to reduce disk space and IO. Use of row or page compression can dramatically improve IO performance, but CPU usage does increase. As long as you are not already seeing CPU bottlenecks, compression may be an option to consider. Be aware that compression is an Enterprise edition feature only. Backup Compression Since SQL Server 2008 R2, backup compression has been available on Standard edition as well as Enterprise. This is major benefit and I recommend that it be enabled on all instances. As well as creating smaller backups, it is also quicker and means less write IO. The small increase in CPU usage is well worth it. Enable it by default so that if someone sets off an ad hoc backup it will have minimal IO impact. Synchronous MirroringAlwaysOn High safety mode in database mirroring, or synchronous commit mode in AlwaysOn, both emphasise availability over performance. A transaction on the mirroring principal server or primary replica does not commit until it receives a message back from the mirror or secondary replica that the transaction has been hardened to the transaction log. This increases transactional latency, particularly when the servers are in different physical locations. Resource Governor in 2014 Up until and including SQL Server 2012 resource governor has only been able to throttle CPU and memory usage. Finally the ability to include IO in a resource pool has been added to SQL Server 2014. This has obvious use as a way of limiting the impact of reports on the system from a particular user, department or application. Gathering The Evidence There are a lot of ways you can measure SQL Server IO performance and identify which areas need looking at. Most of what follows is available in SQL CoPilot in graphical and tabular form, both as averages since last service start and as snapshots of current activity. Wait Types Use sys. dmoswaitstats to check number of waits and wait times for IOCOMPLETION, LOGBUFFER, WRITELOG and PAGEIOLATCH. Use this script to focus on the IO wait types: SELECT waittype. waitingtaskscount. waittimems - signalwaittimems AS totalwaittimems , 1. ( waittimems - signalwaittimems ) CASE WHEN waitingtaskscount 0 THEN 1 ELSE waitingtaskscount END AS avgwaitms FROM sys. dmoswaitstats WHERE waittype IN ( IOCOMPLETION. LOGBUFFER. WRITELOG. PAGEIOLATCHSH. PAGEIOLATCHUP. PAGEIOLATCHEX. PAGEIOLATCHDT. PAGEIOLATCHKP ) This shows averages since the last service restart, or since the wait stats were last cleared. To clear the wait stats, use DBCC SQLPERF (sys. dmoswaitstats, CLEAR) You can also check sys. dmoswaitingtasks to see what is currently being waited for. Virtual File Stats Query sys. dmiovirtualfilestats to find out which data and log files get the most read and write IO, and the latency for each file calculated using the stall in ms. SELECT d. name AS databasename. mf. name AS logicalfilename. numofbytesread. numofbyteswritten. numofreads. numofwrites. 1. iostallreadms ( numofreads 1 ) avgreadstallms. 1. iostallwritems ( numofwrites 1 ) avgwritestallms FROM sys. dmiovirtualfilestats (NULL, NULL) vfs JOIN sys. masterfiles mf ON vfs. databaseid mf. databaseid AND vfs. FILEID mf. FILEID JOIN sys. databases d ON mf. databaseid d. databaseid Performance Counters There are two ways of looking at performance counters. Select from sys. dmosperformancecounters, which shows all the SQL Server counters, or use Windows Performance Monitor (perfmon) to see the other OS counters as well. Some counters to look at are: SQL Server:Buffer Manager Lazy writessec The number of times per second that dirty pages are flushed to disk by the Lazy Writer process. An indication of low memory, but listed here as it causes more IO. Checkpoint pagessec The number of dirty pages flushed to disk per second by the checkpoint process. Page readssec Number of physical pages read from disk per second Page writessec Number of physical pages written to disk per second Readahead pagessec Pages read from disk in advance of them being needed. Expect to see high values in BI workloads, but not for OLTP SQL Server:Access Methods Forwarded recordssec Should be as low as possible. See above for explanation of forwarded records. Full scanssec The number of unrestricted full scans. Use of UDFs and table variables can contribute to this, but concentrating on seeks will help to keep the value down Page splitssec The number of page splits per second - combining splits due to pages being added to the end of a clustered index as well as quotgenuinequot splits when a row is moved to a new page. Use the technique from the link in the section on index fragmentation, above, to get a more accurate breakdown Skipped ghosted recordssec For information about ghosted records see An In-depth Look at Ghost Records in SQL Server Workfiles createdsec A measure of tempdb activity Worktables createdsec A measure of tempdb activity SQL Server:Databases Log bytes flushedsec The rate at which log records are written to disk Log flush wait time The duration of the last log flush for each database Log flush waitssec The number of commits per second waiting for a log flush Logical Disk Avg Disk secsRead Avg Disk secsWrite Avg Disk Read bytessec Avg Disk Write bytessec Using the sys. dmosperformancecounters DMV, a lot of counters display a raw value, which has to be monitored over time to see values per second. Others have to be divided by a base value to get a percentage. This makes this DMV less useful unless you perform these calculations and either monitor over time or take an average since the last server restart. This script uses the tempdb creation date to get the number of seconds since the service started and calculates the averages for these counters. It also retrieves all other counters and calculates those that are derived from a base value. USE master SET NOCOUNT ON DECLARE upsecs bigint SELECT upsecs DATEDIFF ( second. createdate. GETDATE ()) FROM sys. databases WHERE name tempdb SELECT RTRIM ( objectname ) objectname. RTRIM ( instancename ) instancename. RTRIM ( countername ) countername. cntrvalue FROM sys. dmosperformancecounters WHERE cntrtype 65792 UNION ALL SELECT RTRIM ( objectname ), RTRIM ( instancename ), RTRIM ( countername ), 1. CAST ( cntrvalue AS bigint ) upsecs FROM sys. dmosperformancecounters WHERE cntrtype 272696576 UNION ALL SELECT RTRIM ( v. objectname ), RTRIM ( v. instancename ), RTRIM ( v. countername ), 100. v. cntrvalue CASE WHEN b. cntrvalue 0 THEN 1 ELSE b. cntrvalue END FROM ( SELECT objectname. instancename. countername. cntrvalue FROM sys. dmosperformancecounters WHERE cntrtype 537003264 ) v JOIN ( SELECT objectname. instancename. countername. cntrvalue FROM sys. dmosperformancecounters WHERE cntrtype 1073939712 ) b ON v. objectname b. objectname AND v. instancename b. instancename AND RTRIM ( v. countername ) base RTRIM ( b. countername ) UNION ALL SELECT RTRIM ( v. objectname ), RTRIM ( v. instancename ), RTRIM ( v. countername ), 1. v. cntrvalue CASE WHEN b. cntrvalue 0 THEN 1 ELSE b. cntrvalue END FROM ( SELECT objectname. instancename. countername. cntrvalue FROM sys. dmosperformancecounters WHERE cntrtype 1073874176 ) v JOIN ( SELECT objectname. instancename. countername. cntrvalue FROM sys. dmosperformancecounters WHERE cntrtype 1073939712 ) b ON v. objectname b. objectname AND v. instancename b. instancename AND REPLACE ( RTRIM ( v. countername ), (ms). ) Base RTRIM ( b. countername ) ORDER BY objectname. instancename. countername Dynamic Management Views and Functions As well as the DMVs in the above scripts, there are a number of others that are useful for diagnosing SQL Server IO performance problems. Here are all the ones I use. Ill add some sample scripts when I get the time: sys. dmoswaitstats sys. dmiovirtualfilestats sys. dmosperformancecounters sys. dmiopendingiorequests sys. dmdbindexoperationalstats sys. dmdbindexusagestats sys. dmdbindexphysicalstats sys. dmosbufferdescriptors It can also be useful to see what activity there is on the instance. Here are your options: The Profiler tool is quick and easy to use - you can start tracing in a matter of seconds. However, there is some overhead and it may impact performance itself - especially when a lot of columns are selected. A server side trace is a better option. A server-side trace has less of an impact than running Profiler. It has to be scripted using system stored procedures, but Profiler has the ability to generate the script for you. Extended Event Sessions Extended events were first introduced in SQL Server 2008, and have been considerably enhanced in SQL 2012. They are very lightweight, and the use of server-side traces and Profiler is now deprecated. Nevertheless, use of extended events may impact performance of high transaction systems if you are not careful. Use an asynchronous target and avoid complicated predicates to limit the overhead. There are a number of tools for gathering performance data from your servers. SQLIO is a simple tool that creates a file on disk and tests latency and throughput for randomsequential IO, at various block sizes and with a variable number of threads. These are all fully configurable. SQLIO is a great way of getting a baseline on a new server or storage, for future comparison. Third party tools are another option for viewing performance metrics. Some show you what is happening on the server right now. Others are built into more complex (and expensive) monitoring solutions. Performance metrics obtained on virtual servers are unreliable. Performance counters and wait stats may give the impression that everything is OK, when it is not. I recommend the use of the performance monitoring tools provided by the VM vendor. In the case of VMWare, this is very easy to use and is built into Virtual Center. This turned into a much bigger article than I expected - SQL Server IO performance is a big subject I started with everything I knew, and double checked my facts by searching the web and checking books. In the process I learnt a whole lot of new stuff and found a lot of useful links. It has been a useful exercise. Hopefully this has been useful for you too. Window Functions (OVER Clause)Help Make a Difference If I had to name one concept in standard SQL that I thought was the most important one, and that is worth Microsoftrsquos investment for future versions of SQL Server, Irsquod say window functions, hands down, without a doubt. Window functions are a subset of what the standard calls set functions, meaning, functions that are applied to a set of rows. The term window is used to describe the set of rows that the function operates on, and the language provides a clause called OVER where you provide the window specification. So whatrsquos the big deal, and what makes window functions more important than other features that are missing in SQL Server There are so many reasonshellip But first Irsquoll give a bit more background about window functions, and then Irsquoll get to the reasons and demonstrate use caseshellip First, to clarify, SQL Server 2005 already introduced some support for window functionsmdashthe ranking calculations: ROWNUMBER, RANK, DENSERANK and NTILE, and partial support for window aggregate functions with only the partitioning part implemented. SQL Server 2005 was a great release for developers with so many cool and practical T-SQL features. The number of solutions that I simplified and optimized just with the ROWNUMBER function and CTEs is amazing. Still, there are many standard features related to window functions that SQL Server didnrsquot yet implement (as of SQL Server 2008 R2) and that can help address quite a wide variety of business problems with simpler and more efficient solutions. These days the next major release of Microsoft SQL Servermdashversion 11mdashis being developed. These are pivotal days for candidate features where decisions are made whether they will or will not make it to the final release. And even though I think that more complete support for window functions is so important to developers and to the success of SQL Server, Irsquom not sure at all that we will see those in the product. This is time for us as part of the SQL Server community to express our strong opinion. Hopefully Microsoft will realize how important it is for us to have those features in the product, as well as to show that the SQL Server communityrsquos opinion matters. In this article I will explain some of the key features that are missing in SQL Server and why itrsquos important to add support for such features. If you share my opinion, and havenrsquot done so already, you can cast your vote in the following feature request items: Like with any thing in life that yoursquore not aware of, you donrsquot know how it can help you if you donrsquot know that it exists. My feeling is that many developers are not really aware of the capabilities of the standard window functions and therefore Microsoft doesnrsquot see a lot of demand for it. Education and raising the topic to peoplersquos awareness is therefore key to the realization of the benefits, and as a consequence, encourage people to ask Microsoft for more support. The unfortunate part is that all of SQL Serverrsquos leading competitors including Oracle, DB2 and Teradata for some time now already have a far more complete support for window functions. So even though my focus and passion is for SQL Server, I sometimes find myself in the awkward situation of demoing standard SQL window functions on Oracle when teaching or presenting. So whatrsquos missinghellip The most important missing features are probably ordering and framing options for window aggregate functions. Other key features that are still missing are distribution and offset functions, and reusability of window definitions. More details shortly. Why are window functions so powerful SQL is often referred to as a set-based language. The reason is that the language is based on the relational model, which in turn is based, in part, on mathematical set theory. When writing SQL queries yoursquore supposed to deal with a table (or relation, which is a set) as a whole, as opposed to the tablersquos individual rows. Also, since sets have no order, yoursquore not supposed to make any assumptions in regards to the physical ordering of the data. The reality is that for many developers set-based thinking is far from being intuitive, and it can take a few good years to truly think in SQL terms. This is why often developers tend to use cursorsmdashbecause using those feel like an extension to what they already know. Cursors allow you to deal with one row at a time, and also rely on specified order of the data. Window functions have an ingenious design. They do operate on sets, or windows, while allowing you to indicate ordering as part of the calculation where relevant. Not to confuse with cursors, window functions allow defining ordering for the calculation without making any expectations in regards to ordering of the input data given to the query or the output coming out of the query. In other words, no relational concepts are violated. Ordering is only part of the specification of the calculation. Similarly, other common elements in querying problems, like partitioning, framing of applicable rows, are all intuitive parts of the window specification. So in a sense, I see window functions as bridging the big gap that exists between cursoriterative and set-based thinking. Now, thatrsquos a lot of words before showing even one example. So letrsquos look at a few more concrete examples of some of the missing featureshellip Most of the examples Irsquoll show are against a database called InsideTSQL2008. You can find the script creating it here: InsideTSQLbookssourcecodeInsideTSQL2008.zip. In addition, the following view will be used in some of the examples: SET NOCOUNT ON USE InsideTSQL2008 GO IF OBJECTID ( 39Sales. EmpOrders39. 39V39 ) IS NOT NULL DROP VIEW Sales. EmpOrders GO CREATE VIEW Sales. EmpOrders WITH SCHEMABINDING AS SELECT O. empid , DATEADD ( month. DATEDIFF ( month. 0. O. orderdate ), 0 ) AS ordermonth. SUM (OD. qty ) AS qty , CAST ( SUM (OD. qty OD. unitprice (1 - discount )) AS NUMERIC (12. 2 )) AS val , COUNT () AS numorders FROM Sales. Orders AS O JOIN Sales. OrderDetails AS OD ON OD. orderid O. orderid GROUP BY empid. DATEADD ( month. DATEDIFF ( month. 0. O. orderdate ), 0 ) GO Ordering and Framing for Window Aggregate Functions As mentioned, currently window aggregate functions support only a partitioning element. Whatrsquos missing are ordering and framing options. The standard supports an ORDER BY clause to define ordering in the window and ROWS and RANGE clauses that frame the window based on the defined ordering. A classic example that would benefit from ordering and framing is running totals. Consider the following Accounts table definition: CREATE TABLE dbo. Accounts ( actid INT NOT NULL, -- partitioning column tranid INT NOT NULL, -- ordering column val MONEY NOT NULL -- measure CONSTRAINT PKAccounts PRIMARY KEY (actid. tranid ) ) The table represents deposit (positive value) and withdrawal (negative value) transactions in bank accounts. You need to calculate at each point what the account balance was. Like with many querying problems therersquos a partitioning element (actid), ordering element (tranid), and a measure that the calculation applies to (val). Window aggregate functions in standard SQL support all three elements. Herersquos how you would express the query calculating the balance at each point for each account: SELECT actid. tranid. val , SUM (val ) OVER ( PARTITION BY actid ORDER BY tranid ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS balance FROM dbo. Accounts You can achieve such calculations today in SQL Server using a subquery or a join: -- Set-Based Solution Using Subqueries SELECT actid. tranid. val , ( SELECT SUM (S2.val ) FROM dbo. Accounts AS S2 WHERE S2.actid S1.actid AND S2.tranid lt S1.tranid ) AS balance FROM dbo. Accounts AS S1 -- Set-Based Solution Using Joins SELECT S1.actid. S1.tranid. S1.val , SUM (S2.val ) AS balance FROM dbo. Accounts AS S1 JOIN dbo. Accounts AS S2 ON S2.actid S1.actid AND S2.tranid lt S1.tranid GROUP BY S1.actid. S1.tranid. S1.val But besides the fact that these solutions are not as straightforward and intuitive as the one using a window function, therersquos a big problem with the way SQL Server currently optimizes the subquery and join solutions. Assuming you defined a covering index on the partitioning column, followed by the ordering column, and including the aggregated measure, for each row SQL Server will scan all rows with the same partitioning value and an ordering value that is less than or equal to the current. Given p partitions with r rows in average, and fairly even distribution of rows in partitions, the total number of rows processed in such a plan is pr p(r r2)2. This means that in respect to the partition size, the algorithmic complexity, or scaling, of the solution s quadratic (N2). Thatrsquos bad. The window function form lends itself to good optimization, especially with the fast track case like the above (rows between unbounded preceding and current row). It should be straightforward to the optimizer to optimize this query with one ordered scan of the index, translating to simply pr rows being scanned. Another example for running totals is querying a table called EmpOrders with a row for each employee and month, and calculating the cumulative performance for each employee and month in other words, the total value for the employee from the beginning of hisher activity until the current month. Herersquos how you would express it with a window aggregate: SELECT empid. ordermonth. qty , SUM (qty ) OVER ( PARTITION BY empid ORDER BY ordermonth ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS runqty FROM Sales. EmpOrders empid ordermonth qty runqty ----------- ----------------------- ----------- ----------- 1 2006-07-01 00:00:00.000 121 121 1 2006-08-01 00:00:00.000 247 368 1 2006-09-01 00:00:00.000 255 623 1 2006-10-01 00:00:00.000 143 766 1 2006-11-01 00:00:00.000 318 1084 . 2 2006-07-01 00:00:00.000 50 50 2 2006-08-01 00:00:00.000 94 144 2 2006-09-01 00:00:00.000 137 281 2 2006-10-01 00:00:00.000 248 529 2 2006-11-01 00:00:00.000 237 766 . There are many business examples where ordering and framing options can be useful besides calculating account balances. Those include inventory, running totals for reporting, moving averages, and so on. Herersquos an example for a query calculating the average of the last three recorded periods: SELECT empid. ordermonth , AVG (qty ) OVER ( PARTITION BY empid ORDER BY ordermonth ROWS BETWEEN 2 PRECEDING AND CURRENT ROW ) AS avglastthree FROM Sales. EmpOrders There are also various temporal querying problems where running totals serve part of the solution. For simplicity I showed examples where framing is based on the ROWS clause where you indicate an offset in terms of number of rows. The standard also supports a RANGE clause that allows indicating an offset in terms of values, such as time intervals, as in the following example returning the average of the last three months: SELECT empid. ordermonth. qty , SUM (qty ) OVER ( PARTITION BY empid ORDER BY ordermonth RANGE INTERVAL 39239 MONTH PRECEDING ) AS sum3mqty FROM Sales. EmpOrders ORDER BY empid. ordermonth The SQL standard defines several offset functions that would make developersrsquo life so much easier compared to the tools available today for similar needs. Among the missing offset functions are LAG and LEAD, returning a value from a row in a given offset from the current row based on specified ordering. For example, the following query will return, for each current order, also the order date of the previous and next orders: SELECT custid. orderdate. orderid , LAG (orderdate ) OVER ( PARTITION BY custid ORDER BY orderdate. orderid ) AS prvod , LEAD (orderdate ) OVER ( PARTITION BY custid ORDER BY orderdate. orderid ) AS nxtod FROM Sales. Orders custid orderdate orderid prvod nxtod ------- ----------- -------- ----------- ----------- 1 2007-08-25 10643 NULL 2007-10-03 1 2007-10-03 10692 2007-08-25 2007-10-13 1 2007-10-13 10702 2007-10-03 2008-01-15 1 2008-01-15 10835 2007-10-13 2008-03-16 1 2008-03-16 10952 2008-01-15 2008-04-09 1 2008-04-09 11011 2008-03-16 NULL 2 2006-09-18 10308 NULL 2007-08-08 2 2007-08-08 10625 2006-09-18 2007-11-28 2 2007-11-28 10759 2007-08-08 2008-03-04 2 2008-03-04 10926 2007-11-28 NULL . Notice how elegant and intuitive this form is. The default offset is one row, but you can also be explicit if you need an offset that is other than one row, e. g. three rows: SELECT custid. orderdate. orderid , LAG (orderdate. 3 ) OVER ( PARTITION BY custid ORDER BY orderdate. orderid ) AS prv3od FROM Sales. Orders There are lots of business examples for the usefulness of these functions, like recency calculations, trend analysis, and others. Herersquos an example for a query addressing recency calculations, returning the difference in terms of days between the current and previous orders: SELECT custid. orderdate. orderid , DATEDIFF ( day , LAG (orderdate ) OVER ( PARTITION BY custid ORDER BY orderdate. orderid ), orderdate ) AS diff FROM Sales. Orders Other missing offset functions are FIRSTVALUE, LASTVALUE, returning the value from the first or last rows in the partition based on specified ordering. Herersquos an example returning the value of the first and last orders per customer with each order: -- FIRSTVALUE, LASTVALUE SELECT custid. orderdate. orderid. val , FIRSTVALUE (val ) OVER ( PARTITION BY custid ORDER BY orderdate. orderid ) AS valfirstorder , LASTVALUE (val ) OVER ( PARTITION BY custid ORDER BY orderdate. ordered ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS vallastorder FROM Sales. OrderValues custid orderdate orderid val valfirstorder vallastorder ------- ----------- -------- ------- --------------- -------------- 1 2007-08-25 10643 814.50 814.50 933.50 1 2007-10-03 10692 878.00 814.50 933.50 1 2007-10-13 10702 330.00 814.50 933.50 1 2008-01-15 10835 845.80 814.50 933.50 1 2008-03-16 10952 471.20 814.50 933.50 1 2008-04-09 11011 933.50 814.50 933.50 2 2006-09-18 10308 88.80 88.80 514.40 . And herersquos an example calculating the difference between the current order value and the first and last: SELECT custid. orderdate. orderid. val , val - FIRSTVALUE (val ) OVER ( PARTITION BY custid ORDER BY orderdate. orderid ) AS difffirst , val - LASTVALUE (val ) OVER ( PARTITION BY custid ORDER BY orderdate. ordered ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS difflast FROM Sales. OrderValues Standard SQL supports window distribution functions that performing statistical calculations. Specifically it supports the PERCENTRANK and CUMDIST functions, calculating a percentile rank and cumulative distribution. These functions give you a relative rank of a row in respect to other rows in the window partition, expressed as ratiopercent. The specific formulas used by the two variants are: PERCENTRANK: (RK-1)(NR-1), where RK rank, NR number of rows in partition CUMEDIST: NPNR, where NP number of rows preceding or peer with current row (same as next rank - 1) Herersquos an example using these functions: SELECT custid. COUNT () AS numorders , PERCENTRANK () OVER ( ORDER BY COUNT ()) AS percentrank , CUMEDIST () OVER ( ORDER BY COUNT ()) AS cumedist FROM Sales. Orders GROUP BY custid custid numorders percentrank cumedist ------- ---------- ------------ --------- 13 1 0.0000 0.0112 33 2 0.0114 0.0337 43 2 0.0114 0.0337 42 3 0.0341 0.1124 53 3 0.0341 0.1124 . 37 19 0.9545 0.9663 24 19 0.9545 0.9663 63 28 0.9773 0.9775 20 30 0.9886 0.9888 71 31 1.0000 1.0000 Reuse of Window Definition using WINDOW Clause Suppose you need to write several window functions that rely on the same window definition (or part of it). You will end up with a lot of repetition of code. Standard SQL has a clause called WINDOW that allows naming a window definition or part of it, making it reusable. For example, instead of: SELECT empid. ordermonth. qty , SUM (qty ) OVER ( PARTITION BY empid ORDER BY ordermonth ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS runsumqty , AVG (qty ) OVER ( PARTITION BY empid ORDER BY ordermonth ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS runavgqty , FROM Sales. EmpOrders SELECT empid. ordermonth. qty , SUM (qty ) OVER W1 AS runsumqty , AVG (qty ) OVER W1 AS runavgqty , FROM Sales. EmpOrders WINDOW W1 AS ( PARTITION BY empid ORDER BY ordermonth ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) As you can see, with the WINDOW clause the code is shorter, more readable, and easier to maintain. I showed just part of the standard support for window functions that SQL Server is still missing. Therersquos more, like window frame exclusion. There are also other set functions not implemented, like ordered set functions, and so on. But here I wanted to make a point in hope that Microsoft will realize how important it is to add such support in SQL Server 11. If you feel so as well, help make a difference by voting for the items, write about the topic, talk about it, increasing peoplersquos awareness. Hopefully this request will find open ears. As a reminder, here are the open items for some of the requests for enhancements: Thank you for expressing so well what I would haveshould have written a long time ago. Personally a SQLSErver fan, I have had to become expert at Oracle to support our platform for the many customers who still think Oracle is better. While my gripes with Oracle would take many pages to begin to express, I DO like its full support of windows functions, especially LEAD and LAG. No reason to add to what has been already so eloquently said in this post. If there is a polling place anywhere to encourage Microsoft to fully support windows function in a future release, please direct me to it Is it too late for 2011 Looking at the OVER clause in BOL at the moment the enhancements seem entirely under whelming msdn. microsoften-uslibraryms18946128SQL.11029.aspx Please Log In or Register to post comments. Importing SQL Server Data Using SSIS - Which Option is Fastest By: Daniel Calbimonte Read Comments (27) Related Tips: More Integration Services Development This article is useful for SSIS developers who do not know which tasks are best to use in an SSIS projects. The main problem is that at the end of development if performance is slow then you will need to rebuild the project and change components. This article shows various ways of importing data and shows which types of components perform best within SSIS. The contest will be between the following components: ODBC Tasks ADO NET Tasks OLEDB Task SQL Server Destination T-SQL Tasks I created different SSIS packages in order to test performance. In this demo I used SSIS 2012 and the database Adventureworks 2012 . In this demo I am going to import the table AdventureWorks2012.Sales. SalesOrderDetail to the test2 database which is on the same instance of SQL Server. SalesOrderDetails is the table with more rows in AdventureWorks2012. In order to create the database test2 and the destination table dbo. OrderDetails, use this T-SQL code: Test 1 - ODBC Tasks The first example will use ODBC Source and ODBC Destination as shown below: When we run the package we notice the average time is 5 minutes 57 seconds to import the rows: Test 2 - ADO NET Tasks As noticed, ODBC is pretty slow. Lets try another approach. We are going to truncate the destination table first: Lets try ADO tasks to import the same data and verify if these components are faster: The average elapsed time in my testing was 11 seconds. This is much better. Test 3 - OLEDB Tasks This time we are going to import the same data using the OLEDB Tasks. Again we will truncate the table in the test2 database first. The average elapsed time is 5 seconds. Note that I am using the fast load option with the Table Lock option in the OLE DB Destination Task: If we do not use the fast load option, the average elapsed time was 2 minutes and 21 seconds: OK. The fast load option really improves performance. I will return to that configuration. What about the OLE DB Source. By default I am using the option Table or view in the OLE DB Source as shown below: Lets use a SQL Command instead as shown below. The average elapsed time is 2.85 seconds . Test 4 - SQL Server Destination Now, lets try to use the SQL Destination as the destination instead of OLE DB Destination: The average elapsed time is 2.5 seconds. At this point it is the best option. Test 5 - Execute T-SQL Task Finally, some people think that the best option is to use the Execute T-SQL Task: I am using a simple insert statement to import data from one source to another: The average elapsed time is 1.8 seconds Finally Ive been told that if the query runs inside a stored procedure it is even faster: Lets create a stored procedure: After creating the stored procedure we are going to call it in the Execute T-SQL Task: The average elapsed time is 2.12 seconds . The stored procedures does not improve performance. Lets review the table with the results: You may think the morale of the story is to use the Execute T-SQL Task instead of other SSIS tasks. In this example we were importing data on the same instance, but this will not always be the case. So the morale of the story is that there are many alternatives when creating a SSIS project and we have to carefully study the alternatives in different scenarios. There are great SSIS tools and we do not always use the best options. With each new version of SSIS new tasks are added and performance may be improved with existing tasks. The main changes in SSIS for SQL 2008 and 2012 are related to performance improvements. Next Steps If you are working in a SSIS project make sure you are using the best tasks and also verify if there are other SSIS tasks that can be used in your project. Also make sure you are following the best practices recommended by the experts: Last Update: 7132012 Great read and analysis, but I have one caveat to add. If you need to move a large amount of data, you need to take care of the transaction log growth. This is not a much of a concern using SSIS. For instance, I needed to move 1.3 billion rows (15 columns) and began using TSQL which quickly filled my logs. However, using OLE DB Source and Destination (Bulk Inserts) with fast load, there was little impact to the log file. Thursday, September 20, 2012 - 9:19:12 AM - vinodhkumar Its very useful. great job. Thanks Monday, August 27, 2012 - 10:54:42 AM - Orlando Colamatteo I agree with some others that the testbed is a bit contrived. If youre looking to move data from one table to another on the same instance then SSIS will rarely be a viable option. Some form of T-SQL will almost certainly outperform an SSIS operation. A more realistic scenario is moving data between two disparate data sources. It is surpising how poorly the ODBC Destination performs, especially in light of what Microsoft has publicly said in that they will be moving away from OLE DB interfaces and standardizing on ODBC in future products: In the ODBC Destination I expected Microsoft to implement the loading of data via the bulk load API as they did with the FastLoad option of the OLE DB Destination. On a separate note regarding loading data into MySQL with SSIS: In the past I did some performance tests with the Cherry City OLE DB driver for MySQL and it is horribly slow as it only inserts one row at a time. This is not to mention the fact that it crashed BIDS regularly when developing with it. Given the lack of a benefit I would stick with the tools built into SSIS and avoid the hassle of installing and configuring a third party driver. If youre using SSIS 2005 I would recommend using a Script Component as a Destination and issuing batch-inserts against a connection made using the MySQL ODBC Driver: msdn. microsoften-uslibraryms135939.aspx If youre using SSIS 2008 I would recommend using an ADO NET Destination with the MySQL ODBC Driver. In my tests it was only able to achieve about 240 rowsminute throughput to MySQL which is quite disappointing: msdn. microsoften-uslibrarybb895291(vsql.105).aspx If youre using SSIS 2012 I would recommend using an ODBC Destination with the MySQL ODBC Driver. In my tests it outperformed the ADO NET Destination over 3 to 1 but still only achieved about 800 rowsminute throughput, which was still quite disappointing: msdn. microsoften-uslibraryhh758691(vsql.110).aspx

No comments:

Post a Comment