вторник, октября 31, 2006

Book announcement

Hi all!

Finally you can order yet another great book by Jonathan Lewis - Cost-based Oracle Fundamentals!!! Hurry up!
http://www.piter.com/book/978546901309

If you want to understand how Oracle’s Cost Based Optimizer works, you will want to read this book. To get you started, there is a pdf of Chapter 5 (Clustering Factor) that you can download from Apress.

And here is link to the Lewis's blog with some description of this book:
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

вторник, октября 24, 2006

Weekend adventure-2









Again :) We leave Phoenix on Friday and came back only Morning night. That was amazing, my brain slightly confused - to much impressions :) So we've rented a very good car - Nissan Maxima, and first went to Las Vegas, our very smart GPS system with very tender voice lead us to the goal by a very strange path, but thanks God at 3 a.m. we were there. What can I say :) our casinos are much better - they are calm and cosy, casinos in Vegas are huge and crowded. Two blocks from the main street - and you see dirt, junkees, and other stuff like that. After quick review of that monuments and one hour sleep at the parking, we continued our trip to San Diego. I like San Diego, it's very green, beautiful city. And there is OCEAN!!! I and Alex were surfing there for about 2 hours. And we found there our Russian attack submarine - now it's a museum!

вторник, октября 10, 2006

Weekend adventure


Last weekend was full of adventures. First was the Grand Canyon- one of the nature wonders. It's amazing, unbelieveable!!! Such huge hole in earth!











And next trip was city Sedona - very beautiful red mountains! I tried to dig out small cactus and now I'm full of cactus spikes! It hurts :)


пятница, октября 06, 2006

For all office workers :)

My cubicle

среда, октября 04, 2006

Just some pics from the Altai Mountains
















Try to find me :)

Strange games :)



Yesterday we were playing tennis football with Vasil - DBA from Arizona Republic. It's quite strange - tennis court, tennis rules, but instead of tennis balls - ball from soccer :)
Here we are, tired but happy :)

Mountains, my lovely mountains




Yet my another hobby is mountains hiking & climbing. So far I was conquering a peaks at the Altai mountains, now it is time for mountains around Phoenix!
Last Saturday Alex took us to hiking. Thank you, Alex! This was great!

Siberia - the perfect place (c) paraphrase from one song of Army of Lovers





For those of you who don't belive that we have snow, frost & polar bears :)
This was at January, 2005, about -40 celsius, I with my friends from Barnaul, Western Siberia, river Ob.

воскресенье, сентября 17, 2006

Finally we are here :)


Bye-bye Moscow, hello Phoenix!

This was an amazing trip - 12 hours to Atlanta, 3 hours at the Hartsfield-Jackson Atlanta International Airport, 4 hours to Phoenix, and we are here. Thanks Tony for picking us up! First impressions: very hot, very clean, very polite people :) Reluctant to write, see photos :)



At the baseball game - amazing show :)
From left to right - Igor, Noah, Anton, and I - Vladislav Scherbinin!








Quite strange building - like a punchcard.















C'mon braza :)







Another great view.
Small cosy bar.

Tony was (and actually is :) ) so kind and took us to the shopping .

четверг, сентября 07, 2006

Yet another one myth about clustered index in MS SQL 2k

So, there are many myths about clustered index. One of them is that when clustered index exists on the table, databse engine doesn't use IAM pages anymore to retrieve data, it uses doubly-linked list of pages. Also one of my favorite authors - Khen Henderson mentioned about that. This is partially true. I've found that in the read uncommitted isolation level, SQL Server still uses IAM to retrieve data. Here is the repro:

create database test
go
use test
go
drop table dbo.test
go
create table dbo.test (
i int primary key clustered identity(1, 1),
d int
)
go
insert into dbo.test (d)
select top 100000 checksum(newid()) from master..sysobjects s1, master..sysobjects s2, master..sysobjects s3
go

select * from dbo.test with(readuncommitted)
Clustered index scan, the result is:
3328 -1892742514
3329 -1303737718
3330 -1030174007
3331 -157548677
3332 1160183127
98533 -1095189775
98534 -1661674379
98535 -1640363165
98536 1313858725
98537 -271346219

select * from dbo.test
Clustered index scan, the result is :
3328 -1892742514
3329 -1303737718
3330 -1030174007
3331 -157548677
3332 1160183127
3333 -1669536656
3334 -327094669
3335 -1424229963
3336 -923814371
3337 655524158

Why so? Why we've got unsorted result in the first case (I know about ordering guaranties and so on, I'm speaking about different thing)? Let's go more deeply.

dbcc traceon(3604)
go
declare @db_id int, @tbl_id int
select @db_id = db_id('test'), @tbl_id = object_id('test')
dbcc tab (@db_id, @tbl_id)

PageFID PagePID IAMFID IAMPID ObjectID IndexID PageType IndexLevel NextPageFID NextPagePID PrevPageFID PrevPagePID
------- ----------- ------ ----------- ----------- ------- -------- ---------- ----------- ----------- ----------- -----------
1 25 NULL NULL 2073058421 1 10 0 0 0 0 0
1 15 1 25 2073058421 1 2 0 0 0 0 0
1 28 1 25 2073058421 0 1 0 1 29 0 0
1 29 1 25 2073058421 0 1 0 1 30 1 28
1 30 1 25 2073058421 0 1 0 1 31 1 29
1 31 1 25 2073058421 0 1 0 1 33 1 30
1 33 1 25 2073058421 0 1 0 1 34 1 31
1 34 1 25 2073058421 0 1 0 1 35 1 33
1 35 1 25 2073058421 0 1 0 1 1704 1 34
1 1616 1 25 2073058421 0 1 0 1 1617 1 1631
1 1617 1 25 2073058421 0 1 0 1 1618 1 1616
1 1618 1 25 2073058421 0 1 0 1 1619 1 1617


Let's examine the page 1616:
dbcc page('test', 1, 1616, 3)

Slot 0 Offset 0x60
------------------
Record Type = PRIMARY_RECORD
Record Attributes = NULL_BITMAP
6B906060: 000c0010 000180e5 beb8baf1 000002 ...............
i = 98533
d = -1095189775

It is here!!! So, as you see, database engine still uses IAM to retrieve data like in the case of a heap.