m.kelas-karyawan-ftumj.prestasi.web.id Layanan Informasi 17 Jam
Telp/Fax : 021-8762002, 8762003, 8762004, 87912360
HP/SMS : 081 1110 4824 27, 0812 9526 2009, 08523 1234 000
WhatsApp : 0817 0816 486, 0812 9526 2009
email : _Hubungi Kami__ silahkan klik
Chatting dengan Staf :
ggkarir.com
ggiklan.com
Pilih Bahasa :   ID   EN   Permintaan Katalog / Brosur (GRATIS via POS)   Kelas Karyawan   Reguler
BahasaHardwarePendidikan

   
Cari  
    Informasi Sains

    Sebelumnya  (Query language) (Query plan)  Berikutnya    

Query optimization

Query optimization is a function of many relational database management systems. The query optimizer attempts to determine the most efficient way to execute a given query by considering the possible query plans.

Generally, the query optimizer cannot be accessed directly by users: once queries are submitted to database server, and parsed by the parser, they are then passed to the query optimizer where optimization occurs. However, some database engines allow guiding the query optimizer with hints.

A query is a request for information from a database. It can be as simple as "finding the address of a person with SS# 123-45-6789," or more complex like "finding the average salary of all the employed married men in California between the ages 30 to 39, that earn less than their wives." Queries results are generated by accessing relevant database data and manipulating it in a way that yields the requested information. Since database structures are complex, in most cases, and especially for not-very-simple queries, the needed data for a query can be collected from a database by accessing it in different ways, through different data-structures, and in different orders. Each different way typically requires different processing time. Processing times of a same query may have large variance, from a fraction of a second to hours, depending on the way selected. The purpose of query optimization, which is an automated process, is to find the way to process a given query in minimum time. The large possible variance in time justifies performing query optimization, though finding the exact optimal way to execute a query, among all possibilities, is typically very complex, time consuming by itself, may be too costly, and often practically impossible. Thus query optimization typically tries to approximate the optimum by comparing several common-sense alternatives to provide in a reasonable time a "good enough" plan which typically does not deviate much from the best possible result.

Contents

General considerations

There is a trade-off between the amount of time spent figuring out the best query plan and the quality of the choice; the optimizer may not choose the best answer on its own. Different qualities of database management systems have different ways of balancing these two. Cost-based query optimizers evaluate the resource footprint of various query plans and use this as the basis for plan selection. These assign an estimated "cost" to each possible query plan, and choose the plan with the smallest cost. Costs are used to estimate the runtime cost of evaluating the query, in terms of the number of I/O operations required, CPU path length, amount of disk buffer space, disk storage service time, and interconnect usage between units of parallelism, and other factors determined from the data dictionary. The set of query plans examined is formed by examining the possible access paths (e.g., primary index access, secondary index access, full file scan) and various relational table join techniques (e.g., merge join, hash join, product join). The search space can become quite large depending on the complexity of the SQL query. There are two types of optimization. These consist of logical optimization which generates a sequence of relational algebra to solve the query. In addition there is physical optimization which is used to determine the means of carrying out each operation.

Implementation

Most query optimizers represent query plans as a tree of "plan nodes". A plan node encapsulates a single operation that is required to execute the query. The nodes are arranged as a tree, in which intermediate results flow from the bottom of the tree to the top. Each node has zero or more child nodes—those are nodes whose output is fed as input to the parent node. For example, a join node will have two child nodes, which represent the two join operands, whereas a sort node would have a single child node (the input to be sorted). The leaves of the tree are nodes which produce results by scanning the disk, for example by performing an index scan or a sequential scan.

Join ordering

The performance of a query plan is determined largely by the order in which the tables are joined. For example, when joining 3 tables A, B, C of size 10 rows, 10,000 rows, and 1,000,000 rows, respectively, a query plan that joins B and C first can take several orders-of-magnitude more time to execute than one that joins A and C first. Most query optimizers determine join order via a dynamic programming algorithm pioneered by IBM's System R database project[citation needed]. This algorithm works in two stages:

  1. First, all ways to access each relation in the query are computed. Every relation in the query can be accessed via a sequential scan. If there is an index on a relation that can be used to answer a predicate in the query, an index scan can also be used. For each relation, the optimizer records the cheapest way to scan the relation, as well as the cheapest way to scan the relation that produces records in a particular sorted order.
  2. The optimizer then considers combining each pair of relations for which a join condition exists. For each pair, the optimizer will consider the available join algorithms implemented by the DBMS. It will preserve the cheapest way to join each pair of relations, in addition to the cheapest way to join each pair of relations that produces its output according to a particular sort order.
  3. Then all three-relation query plans are computed, by joining each two-relation plan produced by the previous phase with the remaining relations in the query.

In this manner, a query plan is eventually produced that joins all the queries in the relation. Note that the algorithm keeps track of the sort order of the result set produced by a query plan, also called an interesting order. During dynamic programming, one query plan is considered to beat another query plan that produces the same result, only if they produce the same sort order. This is done for two reasons. First, a particular sort order can avoid a redundant sort operation later on in processing the query. Second, a particular sort order can speed up a subsequent join because it clusters the data in a particular way.

Historically, System-R derived query optimizers would often only consider left-deep query plans, which first join two base tables together, then join the intermediate result with another base table, and so on. This heuristic reduces the number of plans that need to be considered (n! instead of 4^n), but may result in not considering the optimal query plan. This heuristic is drawn from the observation that join algorithms such as nested loops only require a single tuple (aka row) of the outer relation at a time. Therefore, a left-deep query plan means that fewer tuples need to be held in memory at any time: the outer relation's join plan need only be executed until a single tuple is produced, and then the inner base relation can be scanned (this technique is called "pipelining").

Subsequent query optimizers have expanded this plan space to consider "bushy" query plans, where both operands to a join operator could be intermediate results from other joins. Such bushy plans are especially important in parallel computers because they allow different portions of the plan to be evaluated independently.

Query planning for nested SQL queries

A SQL query to a modern relational DBMS does more than just selections and joins. In particular, SQL queries often nest several layers of SPJ blocks (Select-Project-Join), by means of group by, exists, and not exists operators. In some cases such nested SQL queries can be flattened into a select-project-join query, but not always. Query plans for nested SQL queries can also be chosen using the same dynamic programming algorithm as used for join ordering, but this can lead to an enormous escalation in query optimization time. So some database management systems use an alternative rule-based approach that uses a query graph model.

Cost estimation

One of the hardest problems in query optimization is to accurately estimate the costs of alternative query plans. Optimizers cost query plans using a mathematical model of query execution costs that relies heavily on estimates of the cardinality, or number of tuples, flowing through each edge in a query plan. Cardinality estimation in turn depends on estimates of the selection factor[disambiguation needed] of predicates in the query. Traditionally, database systems estimate selectivities through fairly detailed statistics on the distribution of values in each column, such as histograms. This technique works well for estimation of selectivities of individual predicates. However many queries have conjunctions of predicates such as select count(*) from R where R.make='Honda' and R.model='Accord'. Query predicates are often highly correlated (for example, model='Accord' implies make='Honda'), and it is very hard to estimate the selectivity of the conjunct in general. Poor cardinality estimates and uncaught correlation are one of the main reasons why query optimizers pick poor query plans. This is one reason why a database administrator should regularly update the database statistics, especially after major data loads/unloads.

See also

  • Join Selection Factor
  • Query optimization
  • Sargable Query

References

See also

  • Sargable

External links

    Sebelumnya  (Query language) (Query plan)  Berikutnya    





Tags: Query optimization, Informasi Sains, 2243, Query optimization Query optimization is a function of many relational database management systems, The query optimizer attempts to determine the most efficient way to execute a given query by considering the possible query plans, Generally the query optimizer cannot be accessed directly by users: once queries are submitted to database server and parsed by the parser they are then passed to the, Query optimization, Bahasa Indonesia, Contoh Instruksi, Tutorial, Referensi, Buku, Petunjuk m.kelas karyawan ftumj, prestasi.web.id
 Permohonan Beasiswa Kuliah    Download Brosur    Pendaftaran Online    Program Perkuliahan Blended di 112 PTS Terbaik    Program Perkuliahan Gratis    Kuliah Pegawai    Program Master (Magister, Pascasarjana, S2)    Program Kuliah Reguler    Perkuliahan Reguler Sore/Malam    Tips & Trik TPA/Psikotes    Kumpulan Perdebatan    Referensi Komputer    Lowongan Karir    Ensiklopedia Bebas
Kuliah Karyawan (Hybrid)
Koleksi Jenis Foto
Penerimaan Mahasiswa/i
Program Studi
Layanan + Download
UU Sisdiknas & Pemerintah Mendukung
Kuliah Karyawan
(Hybrid)

Pustaka Khusus
Daftar Website Kuliah Karyawan
Daftar Website Perkuliahan Reguler Sore/Malam
Daftar Website Seluruh PTS
Daftar Website Kuliah Reguler
Daftar Website Program Magister (S2)

 Bermacam2 Promosi    Waktu Sholat    Al-Quran Online    Tips & Trik TPA/Psikotes
PERMINTAAN BROSUR
(Gratis dikirim via POS)
Nama Penerima Katalog

Alamat Lengkap

Kota / Kabupaten & Provinsi

Kode Pos

Email (tidak wajib)

⍈ harus diisi lengkap & jelas
Atau kirimkan nama dan
alamat lengkap via SMS ke HP:
0811 1990 9026


Download BROSUR
Brosur Kelas Karyawan
Gabungan Seluruh Wilayah Indonesia

pdf (11,2 MB)ZIP (8,8 MB)
Image/jpg (36,2 MB)
Brosur Kelas Karyawan
JABODETABEK

pdf (5,5 MB)ZIP (4,4 MB)
Image/jpg (13,2 MB)
Brosur Kelas Karyawan
DIY,JATENG,JATIM & BALI

pdf (4,4 MB)ZIP (3,5 MB)
Image/jpg (14,5 MB)
Brosur Kelas Karyawan
JAWA BARAT

pdf (2,8 MB)ZIP (2,2 MB)
Image/jpg (7,1 MB)
Brosur Kelas Karyawan
SULAWESI

pdf (1,9 MB)ZIP (1,5 MB)
Image/jpg (5,6 MB)
Brosur Kelas Karyawan
SUMATERA & BATAM

pdf (2,2 MB)ZIP (1,7 MB)
Image/jpg (6,5 MB)
Brosur Kuliah Reguler
pdf (4,1 Mb)ZIP (8,4 Mb)
Kalender NKRI 2023
Image/jpg (2,1 Mb)pdf (400 kb)
Strategi Meningkatkan
Kualitas Pendidikan, Pendapatan dan Sumber Daya PTS

pdf(6 Mb)Image/jpg(16 Mb)

STRATEGI Meningkatkan
Kualitas Pendidikan, Pendapatan dan Sumber Daya PTS
http://kpt.co.id
Terobosan Baru

PT. Gilland Ganesha
Membutuhkan Segera

  • Design Grafis
  • Web Programmer

Penjelasan Lebih Lanjut di :
Info karir

Otitis pada kucing, jenis ras kucing masing2 asosiasi federasi, garukan pasir sanitasi, dsb.
155 Jenis / Ras Kucing di Indonesia


Link Khusus ke
PTS Terakreditasi & Terkemuka
Penyelenggara Program S1, D3, S2

(silakan klik di bawah ini)
STMIKMJ - STMIKMJ Jakarta
IGI - STIE IGI Jakarta
STTM Cileungsi - STIE Cileungsi
STIE WP - STIE Widya Persada
UPRI - UPRI Makassar
STEI - STEI Yogyakarta
STIE - Hidayatullah Depok
STEBI - Bina Essa
P2KKMPoliteknik Aisyiyah

P2KKMUMPTB Lampung
P2KKMSTIT Al-Hikmah Lampung

P2KKMUniv.Amir Hamzah
P2KKMUSM Indonesia
P2KKMUniv. Al-Azhar Medan
P2KKMUniversitas Deli Sumatera

P2KKMUniv. Muh. Palangkaraya

P2KKMSTIT Nur Ahadiyah

P2KKMUniv. Nahd. Ulama Kalbar

P2KKMUniv. Nahd. Ulama Kaltim

Langsa -- Aceh :
P2KKMUSCND Langsa

P2KKMUniv. Ubudiyah Indonesia

P2KKMSTIT Hidayatullah
P2KKMIAI Abdullah Said

P2KKMUniv. Pejuang Rep. Ind.
P2KKMUniv. Teknologi Sulawesi
P2KKMUniv. Cokroaminoto Makassar
P2KKMITeKes Tri Tunas Nasional

P2KKMUniv. Patria Artha

P2KKMUniv. Nusantara, Manado
P2KKMSTIE Pioneer Manado
P2KKMUniversitas Parna Raya Manado

P2KKMUniversitas Boyolali

P2KKMUniversitas Duta Bangsa
P2KKMPoliteknik Harapan Bangsa Surakarta
P2KKMPoliteknik Santo Paulus Surakarta

P2KKMUNIBABWI

P2KKMUniv. Muhammadiyah Smrg
P2KKMUNDARIS Semarang
P2KKMUNAKI Semarang
P2KKMUPGRIS Semarang
P2KKMUniv. IVET Semarang
P2KKMSTIE Cendekia

P2KKMUNUGHA Cilacap

P2KKMUniv. Muhammadiyah Sby
P2KKMSTIE Pemuda Sby
P2KKMIKIP Widya Darma Sby
P2KKMSTIE Widya Darma Sby
P2KKMSTIE ABI Surabaya
P2KKMUNUSA Surabaya
P2KKMUniv. Widya Kartika
P2KKMSTAI Al Akbar Surabaya

P2KKMUniv. Kahuripan Kediri

P2KKMSTAI Muhammadiyah Tulungagung

P2KKMSTIKI Malang
P2KKMSTIE INDOCAKTI
P2KKMSTIE Al Rifa'ie

P2KKMSTIA Bayuangga
P2KKMSTAI Muhammadiyah Probolinggo

P2KKMUniversitas Moch. Sroedji

P2KKMSTEI JOGJA - STEI Yogyakarta
P2KKMSTIE Mitra Indonesia
P2KKMSTiPsi
P2KKMSTAI Terpadu Yogyakarta
P2KKMUniversitas Mahakarya Asia

P2KKMSTIE Hidayatullah
P2KKMSTIE - GICI A
P2KKMSTIE - GICI A


P2KKMSTMIK-MJ - STMIK Muh. Jkt.
P2KKMUNKRIS - Krisnadwipayana
P2KKMSTT Bina Tunggal - Bekasi
P2KKMSTT Duta Bangsa - Bekasi
P2KKMSTIE - GICI C
P2KKMSTEBI Global Mulia
P2KKMUniversitas Pelita Bangsa
P2KKMUniversitas Indonesia Mandiri
P2KKMPoliteknik Bhakti Kartini

P2KKMSTMIK-STIKOM Bali
P2KKMPOLNAS Denpasar
P2KKMUniversitas Bali Dwipa
P2KKMPoltek Ganesha Guru Singaraja

P2KKMSTIE Ganesha
P2KKMSTT Yuppentek
P2KKMITB Ahmad Dahlan
P2KKMUniv. Tangerang Raya
P2KKMSTIA Maulana Yusuf
P2KKMSTIH Gunung Jati
P2KKMSTIE PPI Balaraja

P2KKMUNSUB - Universitas Subang

P2KKMSTIT Al-Hidayah Tasikmalaya

P2KKMSTIE Walisongo
P2KKMSTT Walisongo

P2KKMUniv. Islam Al-Ihya

P2KKMSTT Mandala, Bandung
P2KKMSTT Bandung
P2KKMSTIE Gema Widya Bangsa
P2KKMUniversitas Insan Cendekia Mandiri
P2KKMUniversitas Halim Sanusi
P2KKMUniversitas Persatuan Islam
P2KKMSTEBI Bina Essa

P2KKMSTT Dr. Khez Muttaqien

P2KKMIMWI Sukabumi

P2KKMSTIH Dharma Andigha
P2KKMUniversitas Teknologi Nusnatara

P2KKMSTT Muhammadiyah Cileungsi

P2KKMISTA - Institut ST Al Kamal
P2KKMSTIE IGI - Inter. Golden Inst.
P2KKM Univ. Mpu Tantular B

P2KKMU M J - Univ. Muh. Jkt

P2KKMFISIP UMJ - Univ. Muh. Jkt.
P2KKMFTan UMJ - Agroteknologi
P2KKMSTIE Trianandra Jakarta
P2KKMSTIE - GICI B
P2KKMSTIE Ganesha
P2KKMSTIMAIMMI Jakarta
P2KKMTanri Abeng University

P2KKMUMHT - Univ. MH. Thamrin
P2KKMFE UMHT - FE MH. Thamrin
P2KKMFASILKOM UMHT
P2KKMUNKRIS - Krisnadwipayana
P2KKMITBU - Inst. Tek. Budi Utomo
P2KKMSTIE Trianandra Jakarta
P2KKMSTMIK Muh. Jkt - Matraman
P2KKMSTMIK Muh. Jkt - Ciracas
P2KKMUniv. Mpu Tantular A
P2KKMSTT Sapta Taruna
P2KKMIAI Al-Ghurabaa Jakarta

P2KKMISIF - Institut Studi Islam Fahmina

P2KKMSTEBI Global Mulia

P2KKMSTIKes Sapta Bakti
P2KKMSTAI Miftahul ulum

P2KKMPoltekkes Kerta Cendekia

P2KKMPelita Raya Institute


KPT Konsultan Pendidikan Tinggi

Beritahu Teman
Nama Saya

Email Saya

Email Teman 1
◉ harus diisi dengan benar

Tautan Elok
silakan klik
Ensiklopedis Bebas

1. Universitas Yarsi Pratama - Universitas Yarsi Pratama - Kampus : Jl. Aria Jaya Santika No. 7, Pasir Nangka, Kec. Tigaraksa, Kab. Tangerang, Banten
2. STIE Widya Persada Jakarta - Sekolah Tinggi Ilmu Ekonomi Widya Persada Jakarta - Kampus :Jl. Hj. Tutty Alawiyah No.486, RW.5, Kalibata, Kec. Pancoran, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12740
3. UWIKA Surabaya - Universitas Widya Kartika Surabaya - Kampus UWIKA : Jl. Sutorejo Prima Utara II No.1, Kalisari, Kec. Mulyorejo, Kota Surabaya, Jawa Timur 60112
4. Universitas Wijaya Kusuma Surabaya - Universitas Wijaya Kusuma Surabaya - Kampus : Jl. Dukuh Kupang XXV No.54, Dukuh Kupang, Kec. Dukuhpakis, Surabaya, Jawa Timur 60225
5. Universitas Teknologi Sulawesi Makassar - Universitas Teknologi Sulawesi Makassar - Kampus UTS Makassar : Jl. Talasalapang No.51A, Karunrung, Kec. Rappocini, Kota Makassar, Sulawesi Selatan 90222
6. Universitas Teknologi Nusantara - Universitas Teknologi Nusantara - Kampus UTN : Jl. Kedung Halang Pemda pangkalan II No.66, RT.01/RW.02, Kedunghalang, Kec. Bogor Utara, Kota Bogor, Jawa Barat 16158
p2k.ibisa.ac.id  |  mt-istn.web.id  |  mh-umsurabaya.web.id  |  p2k.stiperjember.ac.id  |  buddhidharma.web.id  |  iais.web.id  |  p2k.cyber-univ.ac.id  |  unismu.web.id  |  stiepasim.web.id  |  unmkramat.web.id  |  unnur.web.id