عرض عملي: استيراد دفعي ومقارنة الأزمنة
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
measure row-by-row against batched inserts; prepares JNR-025-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Create the
producttable withschema.sqlin local PostgreSQL. - Read a 10,000-line CSV into a list of records.
- Insert row by row with auto-commit on; time it with
System.nanoTime(). - Planned mistake: open a new
DriverManagerconnection inside the loop; show how slow it gets, then switch to a pooledDataSource. - Rewrite with
addBatch/executeBatchin chunks of 500 and one commit per chunk; time again. - Compare the two numbers and confirm all rows arrived with
select count(*).
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.