Search This Blog

Saturday, February 27, 2010

Search for the Best Home Security System

Nowadays the criminal rate was increasing due to the economic crisis. so that we need a better protection for our house. several months ago my friends house was burglarized by a thief and he lost many of his precious things. as a friend i don't want that accident happen to me and my family. and then i try to search in the internet for the best home security system that will give us an advanced

Foto Anang Cium Syahrini | Dahsyat Awads 2010 | Video Duet Anang - Syahrini

Gossip kedekatan anang dan syahrini mungkin memang benar. mungkinkah anang menjalin hubungan cinta dengan syahrini?? Ada yang Hot dalam acara Dahsyatnya Awards 2010.Yang ada adalah Video adegan hot Anang cium kening Syahrini.Awalnya mereka berduet menyanyikan single terbaru mereka yang berjudul Jangan Memilih Aku namun diakhir lagu tampak Anang mencium kening Syahrini.Entah ada maksud apa,namun

Thursday, February 25, 2010

Foto Mesra Anang Syahrini

Pasca bercerai dengan KD nampaknya nama anang hermanysah makin terkenal saja di belantika musik indonesia. hits singlenya yang berjudul separuh hati laku keras dimana mana. Sebagai musisi biasanya anang membawakan lagunya duet bersama dengan KD. namun pasca perceraiannya dengan KD anang belum menemukan penyanyi yang cocok berduet dengan dia. kira kira siapa rekan duet anang selanjutnya??

Wednesday, February 24, 2010

Sheila Marcia Melahirkan | Berita Sheila Marcia Melahirkan

Akhirnya Sheila marcia melahirkan seorang bayi perempuan, berita sheila marcia yang telah melahirkan bayi perempuan ini mungkin akan menjadi berita hangat di sejumlah media. bayi perempuan yang dilahirkan sheila berkulit putih. "Bayinya gemuk, putih dan rambutnya tebal," jelas pedangdut Camelia Malik saat ditemui di RS Harapan Bunda, Pasar Rebo, Jakarta Timur,Aktris Sheila Marcia yang sejak

Liz Hurley Glamorous At "Love Ball" at The Roundhouse in London

Liz Hurley Glamorous At "Love Ball" at The Roundhouse in London









Lindsay Lohan At Sun Magazine Photoshoot



Sophie Monk Sexy In Cosmopolitan Australia Magazine



Michelle Trachtenberg Candid at Premiere of "Cop Out" in New York


"My databse is slow" - part 3: some technical stuff

In the previous two posts I tried to show what can affect the overall performance of the database and how important are indexes.
If we assume that the database is normalized, memory settings for the server are ok and we have indexes, the only way to check the performance is monitoring the query plans. Therefore I would like to return once again to the query plans and look at them with more details.

From the previous post, we know that we can generate plans for queries using two commands. These commands are:
  • EXPLAIN SQL_command
  • EXPLAIN ANALYZE SQL_command - this command is a variant of the first with small difference: examined query is executed and EXPLAIN ANALYZE returns the real execuion time.
Using the test database from the previous post, let's see the query plan for the following SQL command:

select * from customers where lname = 'Cervantes';

To see the query plan, execute those two commands:

vacuum analyze;
explain select * from customers where lname = 'Cervantes';

Query plan that has been generated for this query is as follows:



Always we are most interested in "the highest" line of displayed plan - it shows the total cost of the query execution, after all other internal operations for more complex queries (eg joins, sorts, etc.).

In our case we have: (cost: 4.51 .. 59.47 rows = 33 width = 18). What does it mean?
  1. cost: 4.51 .. 59.47 - this is an interval defining total execution time measured in special units called disk page fetches - these units are not seconds nor other units of time. First number estimates time needed to retrieve first row in the result, second estimates total cost of returning all rows in the result. The calculation of this value is "higher mathematics", especially if the query uses more techniques than primitive table sequential scanning - which is the easiest and can be easily calculated. Unfortunately, but only for primitive examples like "select * from some_table" (without the use of indices to be 100% sure that the scan will be performed sequentially and without any query conditions "where"), You can find over the Web some examples of calculating these values. Those who are interested in more details and technical stuff, should visit this page
  2. rows = 33 - this is estimated number of rows returned by a query.
  3. width = 18 - this is estimated size (in bytes) of all the returned rows

Above data are obtained on the basis of statistics located in a special system tables. There are two tables of statistics which are crucial for the query planner:
  1. pg_class - contains information about certain database relations (tables, indexes, etc.), i.e. their location and size.
  2. pg_stats - contains information about the data stored in tables, i.e. the most common values, the frequency of common values occurrence.
Let's see what are the statistics for the table "customers", and what is their impact on some elements of the query plan for above query about user "Cervantes".


Returned data mean that the table "cutomers" has 10.000 records and is located on 62 "pages".


Returned data are based on some statistical data for all the columns in the table "cusotmers" and their content. It is specified which values are most popular, what is their frequency, and amount of values which are different from each other.
What is the meaning of this data in the context of our query about "Cervantes" user?

pg_class - is the basis in calculating the cost of the query execution. For our "Cervantes" query  in the case of sequential scan (if there were no index on the "lname" field in the Customers table), we would calculate the cost from the formula:
(relpages * SEQ_PAGE_COST) + (reltuples * CPU_TUPLE_COST) + (relpages * CPU_OPERATOR_COST)
Capitalized names are costs of arbitrary operation - the are defined in postgresql.conf. Unfortunately (or "fortunately"), our query uses indexes, so the calculation of the cost is a bit more complicated (task for volunteers, formulas are here, You only have to to be familiar with the concepts of "last recently used buffers" (LRU) and Mackert-Lohman formula ;-)).

pg_stats - allows to estimate the number of rows returned in a query using given logical condition (in our case: "where lname = 'Cervantes'"). In our case for the "Cervantes" query we are lucky - "Cervantes" occurs directly in the list of most common surnames, and also is known for its occurrence. The number of rows returned is calculated using the formula:
relpages * selectivity
where:
selectivity = most_common_freqs["Cervantes"]
Hence we get:
10000 * 0,00333333 = 33
And what if we are looking for value which is not in the column "most_common_freqs"? Then the formula has a different form:
selectivity = (1 - sum(most_common_freqs))/(num_distinct - num_most_common_vals)
Calculating selectivity value for the name "Smith", I leave for volunteers as usually ;-). Remember that first You have to execute "vacuum analyze" and then view statistics and then the query plan.

-------------------------------------------- 
Some notes about the statistics:

The content of statistics tables is generated based on random samples taken from the tables in the database. Generating (and therefore refreshing) full statistics takes place during the execution of the VACUUM ANALYZE command. Hence, it is very important to run this command periodically to ensure that statistics for the planner are up to date. Therefore, before showing the above example the first command executed by me was VACUUM ANALYZE in order to query plan be based on the most reliable statistics.
It should be noted that next execution of this command can generate a slightly different statistics, so query plan for the same query may be slightly different (in terms of cost and estimated number of rows). This is because of mentioned random samples taken for calculations.

--------------------------------------------
A few final notes about performance

I can say that the general rule to optimize query execution time is as follows:
"There is no certain way to increase performance in all cases. The best method is trial and error."
In practice it means to try to generate different query plans (in addition to that which is generated by default) and select those with the best execution time. These attempts usually involve forcing the query planner  to behave in different way which leads to a different query plan. This can be achieved through:

1. Forcing the query planner to use an index (often the index exists but is not used by the planner). This can be done for example by:
  • switching off a global sequential scans by setting enable_seqscan = off in postgresql.conf file
  • partial indexes (conditional) - You can create a conditional index for the most frequently returned data in column
  • indexes using multiple fields (watch out for the order - the order of fields in the index should be the same as the order of fields in queries)
  • some SQL tricks related to change the query selectivity, for example using LIMIT, ORDER BY or trailing condition AND TABLE_ID = TABLE_ID (where TABLE_ID is a master key in the table)
2. Changing the order of joining multiple tables, for example executing "(A join B) join C" can be different than executing "A join (B join C)" - this is similar to a problem of  "optmial matrix-chain multiplication".
3. Using stored procedures, views, breaking huge query into a number of smaller queries .

Interesting fact (found over the Web):
In order to monitor the progress of executing a long query to the database (a really long time, not a few seconds) you can create a sequence with the value set to 1 (eg, the sequence "monitor_seq") and add it to executing query:

select nextval('monitor_seq'), column1, column2....

Executing:

select currval('monitor_seq');

at the time of running the long query will show us the progress.

Foto Bella Saphira Berbikini di Arisan Brondong

Film Arisan Brondong kini memang sedang naik daun. dengan adanya adegan bella saphira berbikini dan juga aksi erika kirihara yang bintang porno jepang sangat mengangkat popularitas film arisan brondong itu sendiri. belum lagi poster arisan brondong yang menggunakan 2 orang bintang porno. lalu bagaimana dengan aksi bella saphira yang berbikini di film arisan brondong? seperti apa sih foto foto

Tuesday, February 23, 2010

ST12 Digosipkan Bubar | Gosip Bubar ST12

ST12 band yang digawangi charly, pepep dan pepeng digosipkan akan bubar. benarkah gosip ST12 akan bubar?? sebenarnya gosip bubarnya ST12 ini dibuat karena sang vokalis charly sangat sibuk dengan urusannya sendiri. ST12 sekarang menjadi fenomena di indonesia. lagu lagu mereka yang berirama melayu kental itu diterima oleh masyarakat luas. tidak ada yang menyangka band seperti ST12 bisa begitu tenar

Ibunda Jenny Cortez Menangis Lihat Foto Syur Jenny Cortez

Kasus beredarnya foto syur jenny cortez di film pemburu hantu the movie memang menjadi kontroversi. walaupun sebelumnya jenny cortez telah memberikan tanggapan atas kekecewaannya terhadap production house yang menjebaknya hingga beredar foto syurnya. Jenny Cortez akan mengambil jalur hukum atas kasus tersebarnya foto syur jenny cortez di film pemburu hantu the movie. setidaknya itulah yang

Monday, February 22, 2010

Kristine Hermosa in White Bikini Super Hot!!!


Kristine Hermosa in white bikini. Please right click and open the image to enlarge!

Jenny Cortez di Film Tiran bareng Dewi Persik | Aksi Panas Jenny Cortez di Tiran

Jenny Cortez tampaknya memang hobi berpose syur dan melakukan adegan hot di film ya. belum tuntas kasus foto syur jenny cortez di pemburu hantu the movie. kini sudah muncul lagi berita bugilnya jenny cortez di film terbarunya yang berjudul Tiran alias mati di ranjang. Jenny Cortez melakukan adegan hot bersama dengan dewi persik si janda kembang paling seksi dan sensasional.Beberapa waktu lalu

Kasus Joseph Refo Bendahara PSSI Bunuh Maria Reni Widowati | Joseph Refo Bunuh Istrinya

Joseph Refo yang dikenal sebagai bendahara PSSI terlibat kasus pembunuhan, kasus pembunuhan yang dilakukan oleh joseph refo menimpa sang istri yang bernama maria reni widowati. entah masalah apa joseph tega memukul maria reni widowati dengan laptop dan dengan benda keras.Kasus Joseph Refo ini menuai banyak kecaman di masyarakat. sangat disayangkan jika seorang pejabat PSSI tega melenyapkan nyawa

Sunday, February 21, 2010

Selly Yustiawati Menipu dan Rela Ditiduri Korban

Selly Yustiawati memang belum tertangkap hingga saat ini. selly yustiawati dikenal sebagai penipu ulung yang telah berhasil menipu banyak orang dan meraup keuntungan ratusan juta rupiah. ternyata dibalik itu Selly juga memberikan tubuhnya untuk dinikmati para korbannya. Karena itulah kenapa korban penipuan Selly Yustiawati malu untuk melapor ke polisi. Selly ternyata juga tidur dengan sebagian

Jenny Cortez Dan Foto Syurnya | Tanggapan Jenny Cortez

Masih ingat dengan kasus foto bugil jenny cortez di film pemburu hantu the movie yang telah saya posting beberapa hari lalu di dunia celeb. menanggapi kasus beredarnya foto syur jenny cortez di film pemburu hantu the movie tampaknya jenny cortez sangat kecewa. hal ini disampaikan langsung di blog pribadi jenny cortez.Berikut ini adalah kutipan dari blog pribadi jenny cortez yang menyatakan bahwa

Saturday, February 20, 2010

Aksi Erika Kirihara di Arisan Brondong | Foto Erika Kirihara

Erika Kirihara dalam film arisan brondong? aksi erika kirihara dalam arisan brondong?? apakah anda penasaran ingin lihat koleksi erika kirihara di arisan bronodng?Erika Kirihara yang merupakan artis JAV Idol alias bintang porno jepang namanya kian melambung di indonesia, beberapa waktu lalu erika kirihara terlibat dalam film arisan brondong yang juga diperankan oleh tante bella saphira yang nekad

Friday, February 19, 2010

Foto Seksi Sarah Azhari Terbaru | Foto Sarah Azhari Delta Spa Medan

Foto Terbaru Sarah Azhari 2010 - Foto terbaru sarah azhari di delta spa medan yang menggunakan busana merah seksi ini akan banyak dicari orang karena baru saja beredar foto terbaru sarah azhari di tahun 2010. Sarah Azhari memang menjadi fenomena karena begitu banyaknya berita dan foto seksi sarah azhari yang menjadi konsumsi publik. sepertinya sarah tidak pernah risih dengan pose pose seksinya.

Mischa Barton New hairdo leaving Byron & Tracey Salon in Bev. Hills

Mischa Barton New hairdo leaving Byron & Tracey Salon in Bev. Hills







Ashley Greene Sexy In Maxim Outakes



Olivia Wilde In Elle Magazine March 2010



Michelle Trachtenberg Hot In Complex Magazine



Jessica

Thursday, February 18, 2010

Erika Kirihara Artis JAV di Film Arisan Brondong | Foto Hot Erika Kirihara

Erika Kirihara juga tercatat sebagai salah satu artis pendukung film arisan brondong. siapakah erika kirihara? apa anda pernah dengar nama erika kirihara??Ternyata film arisan brondong tidak hanya dimainkan oleh tante bella saphira yang rela berbikini dan meliuk liukan bokong lalu anita hara yang seksi dan juga andi soraya yang kena cekal akibat aksi topless nya di film hantu puncak datang bulan.

Foto Syur Jenny Cortez di Film Pemburu Hantu | Behind the Scene Pemburu Hantu The Movie

Lagi lagi foto hot jenny cortez beredar di internet. beberapa hari lalu di dunia celeb sudah kita tampilkan foto syur jenny cortez yang topless. Foto-foto topless Jenny Cortez yang beredar tanpa sepengetahuannya membuat ia geram dan menuntut PH dari film itu membayar RP 1 Miliar.Dia juga merasa dijebak,pasalnya dalam adegan itu harusnya gak ada kamera lain selain kamera dari PH tapi nyatanya

Tattoo Baru Julia Perez

Julia Perez punya tattoo baru di leher nih... kabarnya jupe juga pernah mentattoo bagian terlarangnya juga lohJulia Perez alias jupe memang sensasional, berita mengenai jupe selalu menjadi topik hangat, misalnya beberapa hari lalu foto julia perez sebagai guru seksi banyak di cari di internet dan juga beberapa bulan lalu foto dugem julia perez dan foto julia perez jadi DJ juga menjadi pembahasan

Bupati Selingkuh di Facebook | Qomariyah Ponco | Kasus Foto Mesum Qomariyah Ponco

Pasangan Bupati selingkuh di facebook?? sudah dengar kasus qomariyah ponco yang sekarang sedang hot di google?? Qomariyah dan ponco adalah pasangan bupati dan wakil bupati pekalongan yang selingkuh dan memposting foto mesum mereka di facebook. dalam akun qomariyah ponco di facebook terdapat 22 foto syur pasangan bupati mesum ini yaitu qomariyah ponco.Menurut data di facebook qomariyah ponco foto

Wednesday, February 17, 2010

Piyu Padi Menang Lelang Mercy C250 AVA

Piyu Padi alias Satria yudi wahono memenangkan lelang mobil mercy C250 AVA yang dibatik dengan airbrush.. sungguh luar biasa. menangnya juga tidak tanggung tanggung tuh si piyu padi. dia menang lelang mobil ini di angka fantastis yaitu 1 milliar rupiah. mobil mercy C250AVA ini pun diberi plat nomor P 1 YU yang mengartikan nama sang gitaris padi ini. berikut adalah berita tentang Piyu memenangkan

Foto Hot Vina Panduwinata

Foto Hot Vina Panduwinata yang memperlihatkan jelasnya belahan dada vina panduwinata beredar di internet. walaupun usia diva ini sudah tidak muda lagi namun belahan payudaranya masih saja menggoda para pria yang suka dengan belahan dada wanita. masih ingat kan sosok si burung camar yang selalu tampil seksi walau sudah tidak muda lagi. si pelantun surat cintaku ini memang termasuk ke salah satu

Foto Mesra Mike Lewis - Tamara Blezinsky

Mike lewis dan Tamara Blezinsky memang sudah resmi menikah. bahkan hingga saat ini publik masih mencari tau bagaimana foto pernikahan tamara blezinsky dengan mike lewis. kabarnya foto pernikahan mereka akan dijual ke sebuah lembaga apa gitu yah...Nah bagi yang masih penasaran dengan foto pernikahan tamara blezinsky dan mike lewis di bali, maka saat ini dunia celeb hanya bisa memberikan foto mesra

Pixie Lott Cute At BRIT Awards 2010

Pixie Lott Cute At BRIT Awards 2010


















Gemma Atkinson Cute Lingerie Photoshoot



Emily Blunt Gorgeous At the Los Angeles premiere of The Wolfman



Rhian Sugden At a lingerie store opening



Sarah

Foto Hot Jenny Cortez | Jenny Cortez Bugil

Foto Hot Bugil Jenny Cortez Beredar luas di internet.. Kasus cabul foto selebritis kembali beredar. kali ini kasus foto bugil artis menghinggapi jenny cortex. seperti kita lihat dalam foto hot jenny cortez di bawah, jenny terlihat sedang mandi. dan hanya berbalutkan handuk saja. jenny cortez adalah artis pemeran film air terjun perngantin bersama dengan tamara blezynski yang baru saja menikahi

Sinopsis Film Arisan Brondong

Arisan brondong merupakan salah satu berita yang sedang in saat ini. film arisan brondong yang diperankan tante bella saphira ini lain daripada yang lain dimana bella saphira berakting hot di film arisan brondong yaitu dengan meliuk liukan bokongnya dan juga berbikini di film arisan brondong.Penasaran dengan alur cerita arisan brondong??? simak sinopsis film arisan brondong versi lengkap dan juga

Tuesday, February 16, 2010

Kemben Melorot Julia Perez

Julia Perez kembennya melorot dalam sebuah acara di sebuah stasiun televisi. akibat insiden kemben melorot julia perez, terlihat jelas belahan payudara julia perez yang memang seksi dan berisi. belum lama ini di dunia celeb kita sempat membahas mengenai Julia Perez yang ingin jadi guru seks. memang tidak bisa dipungkiri julia perez adalah salah satu artis indonesia yang lekat dengan image seksi

Foto Rok Mini Bella Saphira di Launching Arisan Brondong

Udah pernah lihat bella saphira pake rok mini hingga celana dalamnya jelas kelihatan? beberapa waktu lalu baru saja kita saksikan mengenai sinopsis film arisan brondong yang dioerankan oleh Bella Saphira, Andi Soraya dan Anita Hara yang berperan sebagai tante girang yang sedang mencari brondong..Dalam film Arisan Brondong Bella Saphira untuk pertama kalinya ditawari adegan hot dan seksi dengan

Monday, February 15, 2010

Bella Saphira Berbikini di Film Arisan Brondong | Foto Hot Bella Saphira

Foto hot Bella Saphira kembali beredar. kali ini foto hot bella saphira menggunakan bikini dan memperlihatkan belahan dadanya. foto hot bella saphira dengan bikini ini dibuat untuk film arisan brondong. wuah film baru apalagi nih?? ada lagi film baru yang mempertontonkan kemolekan tubuh wanita.Bila Film Hantu Puncak Datang Bulan yang dibintangi si Andi Soraya sudah cukup vulgar dengan adegan

Saturday, February 13, 2010

Foto Bugil (Mirip) Mey Chan Duo Maia Beredar

Foto Bugil mirip mey chan vokalis duo maia kini beredar luas di internet, entah siapa yang pertama kali menyebarkan foto bugil ini, yang jelas ini mungkin saja bukanlah foto asli meychan yang bugil melainkan orang yang mirip mey chan. ingat seperti kasus foto bugil mirip aura kasih beredar?? wah wah sepertinya trend foto bugil artis akan semakin berkembang nih.. setelah yang terakhir beredar foto

Katie Price Attends the Vienna Opera Ball February 11th

Katie Price Attends the Vienna Opera Ball February 11th





Emily Blunt Gorgeous At the Los Angeles premiere of The Wolfman



Rhian Sugden At a lingerie store opening



Sarah Harding in bikini top at Barbados 7th February