對於「新手」問題,我提前表示歉意,但我仍然從根本上說是SQL的大多數方面的新手。 我的問題源於SQL藝術中第二章的一部分。在題爲「穩定的數據庫連接」的段落中,作者提到了幾種將大量行插入數據庫的方法。下面是格式中的相應列表在記錄插入方面的高效數據庫訪問
Test; Results Connect/Disconnect for each line in turn; 7.4 lines loaded per second Connect Once, all candidate lines individually inserted; 1,681 lines loaded per second Connect Once, all candidate lines inserted in arrays of 10 lines; 5,914 lines inserted per second Connect Once, all candidate lines inserted in arrays of of 100 lines; 9,190 lines inserted per second
另外,作者提到「直接加載技術甚至更快」。
不幸的是,我不完全理解插入數組的想法(如果有的話)。任何人都可以詳細說明作者提到的插入數組和他引用的其他「直接加載技術」的技術嗎?
我會補充說(至少在SQL Server上),您可以發送XML文件並從中插入行。這很快。不如批量插入快,但與「格式化」INSERT INTO表格一樣快 – xanatos