Improve database efficiency with virtual hard disks (using memory as a hard drive)

Source: Internet
Author: User
Tags advantage

The last one aroused everyone's discussion, looked at the discussion I was more dizzy, this also blame I did not say clearly, so again make up a continuation of the question to say clearly.

Notebook configuration

Cpu:core 2 7250 2.0G

Memory: 4G, where 2G is set up as a virtual hard disk, virtual hard disk software: Ramdisk. READ: 5.5G, write: 3.5G.

Hard disk: 160G, average read: 70m/s. Write: Unknown, not read fast.

(The read speed of memory is 785 times times the read speed of the hard disk.) )

Here is the test of my Notebook: http://www.cnblogs.com/jyk/archive/2009/05/10/1453551.html

Software: SQL Server 2000,asp.net2.0

There are several important databases in SQL Server 2000, master, model, msdb, and tempdb, where the main thing to say is the tempdb database, which has a msnd introduction.

Objective: To increase the speed at which SQL Server 2000 displays data.

Idea: Put tempdb in the virtual hard disk (ie memory), the use of memory to read and write faster than the advantages of hard disk, improve speed.

The events:

In Wednesday, the idea is to put the customer's database directly on the virtual hard disk test speed, that is, compare to see how much performance, if performance can improve a lot of words, then consider to ensure the security of data, that is, in the event of an accident, to ensure that the data can not be lost.

I want to see first how much performance can improve, if the increase in the number of words to apply value, if the improvement is weak, it is not worth a bit. So I took advantage of the Northwnd from SQL Server 2000, and copy the data from the Products table inside to 2.5 million for testing. Then copy the database file into two copies, one on the physical hard disk, attached to the database, called Northwnd_disk, and the other on the virtual hard disk (that is, memory), attached to the database, called Northwnd_ram. All right, two databases ready, let's start the test.

I first tested the ability to use the index, using the max paging algorithm, sorted by ProductID (primary key, clustered index). Two databases do not timeout, Northwnd_ram can be increased by about 8 times times the efficiency, basic still.

It is good to be able to use the index, but a lot of things can not use the index Ah, then can not take advantage of the index, the virtual hard disk can bring how much performance improvement? So I did a second experiment.

Cannot take advantage of the index, or use the two database, this time in accordance with the order by ProductName, ProductID the conditions to pagination, using the reverse top of the paging algorithm (note here is not want to discuss the efficiency of the paging algorithm, but to see the efficiency of the virtual hard disk).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.