خمس عادات لاستعلامات أسرع / Five habits for faster queries

آخر تحديث: 8 أكتوبر 2026 / Last updated: 8 October 2026

قواعد البيانات / Databases

عادات صغيرة في كتابة SQL توفّر ثواني على كل صفحة.
Small SQL habits that save seconds on every page.

#SQL

  1. اختر الأعمدة التي تحتاجها، لا *.
  2. استعمل القيم المربوطة بدل لصق القيم في النص.
  3. لا تلفّ العمود بدالة في WHERE.
  4. ضع فهرساً على أعمدة الربط.
  5. اجلب صفحة من النتائج، لا كل شيء.
اعرف أي ربط تحتاج
اعرف أي ربط تحتاج

القيم المربوطة أسرع، وتمنع حقن SQL أيضاً.

  1. Select the columns you need, not *.
  2. Use bound values instead of pasting values into the text.
  3. Never wrap the column in a function in WHERE.
  4. Index your join columns.
  5. Fetch one page of results, not everything.
Know which join you need
Know which join you need

Bound values are faster, and they prevent SQL injection too.

↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق↑ ↓ to move · Enter to open · Esc to close