Posted in General

Which is beter DB?

Ok this is intresting topic. We started a discussion about databases. In just my past company we have develop & deployed 35+ SQL Server based applications and few Oracle ones. A colleague of mine gave me a run though IBM DB2. It sounds like very promising database. I just want to run a script on different databases and see how good their execution times are. Probably compare them as well.

Concept of test:

Create a table with 1 10 character column with 10 records initially. Now do a SELECT INTO self 20 times to get 1 Million records. Record the times in various databases.

The code would be as follows, we have to mak udpates to script for each databases.


--SqlCreateTable.sql
--Creates Table and inserts 10 records
CREATE TABLE [SizeTest] (
[Col] [nvarchar] (10) COLLATE Latin1_General_CI_AS NOT NULL
)
GO

--Add 10 records
INSERT INTO SizeTest(Col)
SELECT 'AAAAAAAAAA'
UNION
SELECT 'BBBBBBBBBB'
UNION
SELECT 'CCCCCCCCCC'
UNION
SELECT 'DDDDDDDDDD'
UNION
SELECT 'DDDDDDDDDD'
UNION
SELECT 'FFFFFFFFFF'
UNION
SELECT 'GGGGGGGGGG'
UNION
SELECT 'HHHHHHHHHH'
UNION
SELECT 'IIIIIIIIII'
UNION
SELECT 'JJJJJJJJJJ'


--InsertScript.sql
--5 Times for each TRANS
--2 times = 10k records
--Each record has 10 characters

DECLARE @I INT
DECLARE @N INT
SET @I = 1
SET @N = 20

while @I

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s