News:

Semoga anda berbahagia _/\_

Main Menu

INDEXING

Started by juliahutapea, 03 January 2011, 05:54:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

juliahutapea

tanya donk teman...

gw baca ada thread sebelumnya yang ngebahas ttg indexing juga..
tapi mash kurang ngeh...
indexing itu kita lakukan di salah satu kolom di database khan?
nahh..rata2 khan uda ada fungsi indexingnya dari sql servernya

klo mau buat indexing manual gmn ya?

ty

morpheus

index dibikin supaya mencari jadi lebih cepat. kalo tidak ada index, db akan mencari secara linier, yg akan memakan waktu lebih lama.
* I'm trying to free your mind, Neo. But I can only show you the door. You're the one that has to walk through it
* Neo, sooner or later you're going to realize just as I did that there's a difference between knowing the path and walking the path

johan3000

As mentioned in the Index overview page, a table index helps SQL statements run faster. The syntax for creating an index is:

QuoteCREATE INDEX "INDEX_NAME" ON "TABLE_NAME" (COLUMN_NAME)

Let's assume that we have the following table,

TABLE Customer
(First_Name char(50),
Last_Name char(50),
Address char(50),
City char(50),
Country char(25),
Birth_Date date)


and we want to create an index on the column Last_Name, we would type in,

CREATE INDEX IDX_CUSTOMER_LAST_NAME
on CUSTOMER (Last_Name)

If we want to create an index on both City and Country, we would type in,

CREATE INDEX IDX_CUSTOMER_LOCATION
on CUSTOMER (City, Country)
Nagasena : salah satu dari delapan penyebab matangnya kebijaksanaan dgn seringnya bertanya

Sunkmanitu Tanka Ob'waci

patokannya kita buat index untuk kolom yang sering diakses dan foreign key.
HANYA MENERIMA UCAPAN TERIMA KASIH DALAM BENTUK GRP
Fake friends are like shadows never around on your darkest days