//honeypot demagogic

 Forum DhammaCitta. Forum Diskusi Buddhis Indonesia

Author Topic: INDEXING  (Read 1519 times)

0 Members and 1 Guest are viewing this topic.

Offline juliahutapea

  • Bukan Tamu
  • *
  • Posts: 1
  • Reputasi: 0
  • Semoga semua mahluk berbahagia
INDEXING
« on: 03 January 2011, 05:54:17 PM »
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

Offline morpheus

  • Global Moderator
  • KalyanaMitta
  • *****
  • Posts: 2.750
  • Reputasi: 110
  • Ragu pangkal cerah!
Re: INDEXING
« Reply #1 on: 03 January 2011, 10:12:18 PM »
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

Offline johan3000

  • KalyanaMitta
  • *****
  • Posts: 11.552
  • Reputasi: 219
  • Gender: Male
  • Crispy Lotus Root
Re: INDEXING
« Reply #2 on: 04 January 2011, 02:15:45 AM »
As mentioned in the Index overview page, a table index helps SQL statements run faster. The syntax for creating an index is:

Quote
CREATE 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

Offline Sunkmanitu Tanka Ob'waci

  • Sebelumnya: Karuna, Wolverine, gachapin
  • KalyanaMitta
  • *****
  • Posts: 5.806
  • Reputasi: 239
  • Gender: Male
  • 会いたい。
Re: INDEXING
« Reply #3 on: 04 January 2011, 02:06:52 PM »
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

 

anything