SQL Performance Tuning [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

SQL Performance Tuning [Electronic resources] - نسخه متنی

Peter Gulutzan, Trudy Pelzer

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید




Style Notes


When you execute several SQL statements sequentially, it's important to use a consistent style. For example, instead of running these two SQL statements:


SELECT column1*4 FROM Table1 WHERE COLUMN1 = COLUMN2 + 7
select Column1 * 4 FROM Table1 WHERE column1=(column2 + 7)

run these two statements:


SELECT column1 * 4 FROM Table1 WHERE column1 = column2 + 7
SELECT column1 * 4 FROM Table1 WHERE column1 = column2 + 7
GAIN: 2/8

"But there's no difference!" you may exclaim. Well, semantically all four SELECTs are the same. The trick, though, is that some DBMSs store parsed results from previous queries and will reuse them if the queries are precisely the sameincluding spaces and capitalization. So a firm, consistent style will not only make SQL statements easier to readit just might make them run faster!

We're not going to give you a style guide here because that's not the purpose of this book. But we will observe that the transform in the example used some common and easy-to-remember rules:


Keywords uppercase but column names lowercase.


Table names initial capitalized.


Single spaces around each word and around each arithmetic operator.



/ 124