Moving-average-ms-sql

Moving-average-ms-sql

Kelas-forex-kelantan
Tidak ada indikator-strategi trading- (nits)
Tutorial-on-option-trading


Options-trading-practice-account How-to-trade-forex-online Perhitungan harga rata-rata Sap-mm-moving-average Apa-apakah-vested-stock-options-mean Sinyal robot-forex Rock-n-roll-trading-system

Oleh Denise Etheridge Anda dapat menggunakan tutorial online gratis ini untuk belajar Microsoft Excel 2003 atau 2002, klik di sini untuk memulai. Jika Anda menggunakan Excel 2007, klik di sini untuk tutorial Excel 2007 kami. Microsoft Excel adalah spreadsheet elektronik yang berjalan di komputer pribadi. Anda bisa menggunakannya untuk mengatur data Anda ke dalam baris dan kolom. Anda juga bisa menggunakannya untuk melakukan perhitungan matematis dengan cepat. Tutorial ini mengajarkan dasar-dasar Microsoft Excel. Meskipun pengetahuan tentang bagaimana menavigasi di lingkungan Windows sangat membantu, tutorial ini dibuat untuk pemula komputer. Pelajaran ini akan mengenalkan Anda ke jendela Excel. Anda menggunakan jendela untuk berinteraksi dengan Excel. Pelajaran 1 membiasakan Anda dengan jendela Excel 2007. Kekuatan utama Excel adalah Anda dapat melakukan perhitungan matematis dan memformat data Anda. Dalam pelajaran ini, Anda belajar bagaimana melakukan perhitungan matematika dasar dan bagaimana memformat teks dan data numerik. Dengan menggunakan fungsi, Anda dapat dengan cepat dan mudah membuat banyak perhitungan berguna, seperti menemukan angka rata-rata, angka tertinggi, angka terendah, dan hitungan jumlah item dalam daftar. Microsoft Excel memiliki banyak fungsi yang bisa Anda gunakan. Pelajarannya mengajarkan Anda bagaimana cara menggunakan fungsi dan cara mencetaknya. Di Microsoft Excel, Anda dapat mewakili angka dalam tabel. Pelajaran ini mengajarkan Anda bagaimana membuat bagan di Excel. Metrik kinerja disk server SQL Bagian 2 ukuran kinerja disk penting lainnya Di bagian sebelumnya dari serangkaian metrik kinerja SQL Server, kami menyajikan metrik kinerja disk yang paling penting dan berguna. Sekarang, tunjukkan dengan baik ukuran kinerja disk penting lainnya Durasi Antrian Disk Saat Ini Menunjukkan jumlah permintaan disk yang saat ini menunggu serta permintaan yang saat ini dilayani. Tunduk pada variasi yang luas kecuali jika beban kerja telah mencapai kondisi mapan dan Anda telah mengumpulkan sampel yang cukup untuk membentuk sebuah pola. 1 Metrik menunjukkan berapa banyak operasi IO yang menunggu untuk ditulis atau dibaca dari hard drive dan berapa banyak yang saat ini diproses. Jika hard drive tidak tersedia, operasi ini antri dan akan diproses saat disk tersedia. Seluruh subsistem disk memiliki antrian tunggal Metrik Panjang Antrian Disk Berjalan pada Monitor Kinerja Windows tersedia untuk disk fisik dan logis. Pada beberapa versi Monitor Kinerja sebelumnya, penghitung ini dinamai Panjang Antrian Disk Nilai Antrian Disk Lebar Panjangnya harus kurang dari 2 per cakram disk. Perhatikan bahwa ini bukan per logis, tapi per disk fisik. Jika lebih besar, ini menunjukkan potensi kemacetan disk, jadi penyelidikan lebih lanjut dan pemantauan metrik disk lainnya dianjurkan. Mulailah dengan memonitor Disk Time (dijelaskan di bawah). Puncak yang sering juga harus diselidiki Sistem array disk seperti RAID atau SAN memiliki sejumlah besar disk dan kontroler, yang membuat antrian pada sistem seperti itu lebih pendek. Karena metrik doesnt menunjukkan antrian per disk, tapi untuk keseluruhan array, beberapa DBA mempertimbangkan bahwa memonitor Current Disk Queue Length pada array disk tidak diperlukan Skenario lain dimana Antrian Disk Saat Ini Panjang dapat menyesatkan adalah ketika data disimpan dalam cache disk. Ini akan dilaporkan sebagai antri untuk penulisan dan dengan demikian nilai Antrian Disk Lebar Saat Ini akan lebih tinggi dari Rata-rata Panjang Antrian Disk Rata-rata Rata-rata Panjang Antrean Antrian Disk menunjukkan informasi yang serupa dengan Panjang Antrian Disk Saat Ini. Hanya nilainya yang tidak lancar tapi rata-rata selama periode waktu tertentu. Ambang batasnya sama seperti untuk metrik sebelumnya hingga 2 per disk. Untuk sistem disk, nilai yang disarankan kurang dari 2 per disk drive individual dalam sebuah array. Misalnya, dalam 6 disk array Current Disk Queue Length sebesar 12 berarti antrian adalah 2 per disk Ada dua metrik lainnya yang mirip dengan Rata-rata Panjang Antrian Disk 8211 Rata-rata Disk Membaca Panjang Antrian dan Rata-rata Disk Menulis Antrian Panjang. Seperti nama mereka menunjukkan bahwa mereka menunjukkan rata-rata panjang antrian untuk operasi yang menunggu disk dibaca atau ditulis Disk Time Counter ini menunjukkan adanya masalah disk, namun harus diperhatikan bersamaan dengan penghitung Panjang Antrian Disk Saat ini agar benar-benar informatif. Ingat juga bahwa disk bisa menjadi hambatan sebelum Disk Time mencapai 100 2 Metrik Disk Time menunjukkan bagaimana sibuknya disk melayani permintaan baca dan tulis, namun seperti yang dinyatakan di atas, ini bukan indikasi masalah yang jelas, karena nilainya Dapat menjadi normal sementara ada masalah kinerja disk yang serius. Nilainya adalah nilai Panjang Antrian Disk Rata-rata yang ditunjukkan dalam persentase (yaitu dikalikan dengan 100). Jika Rata-rata Panjang Antrian Disk adalah 1, Disk Time adalah 100 Apa yang bisa membingungkan adalah nilai Disk Time bisa lebih dari 100, yang isnt logis. Hal ini terjadi jika nilai rata-rata Antrian Disk Rata-rata lebih besar dari 1. Jika Rata-rata Panjang Antrian Disk adalah 3, Disk Time adalah 300, yang doesnt berarti bahwa proses menggunakan waktu disk 3 kali lebih banyak dari yang tersedia, atau bahwa ada hambatan Jika Anda Memiliki array hard disk, total waktu disk untuk semua disk ditampilkan, tanpa indikasi berapa banyak disk yang tersedia dan disk apa yang memiliki Disk Time tertinggi. Misalnya, Disk Time sebesar 500 mungkin menunjukkan kinerja yang baik (jika Anda memiliki 6 disk), atau sangat buruk (jika Anda hanya memiliki 1 disk). Anda tidak bisa mengatakannya tanpa mengetahui perangkat keras mesin Karena counter ini bisa menyesatkan, beberapa DBA tidak menggunakannya karena ada beberapa metrik lain yang lebih mudah dan menunjukkan kinerjanya jika nilai lebih tinggi dari 90 per disk, diperlukan penyelidikan tambahan. Pertama, periksa nilai Panjang Antrian Disk Terusan. Jika lebih tinggi dari ambang batas (2 per disk fisik), monitor jika nilai tinggi sering terjadi. Jika mesin tidak digunakan hanya untuk SQL Server, aplikasi intensif sumber daya lainnya dapat menyebabkan kemacetan disk, jadi kinerja SQL Server akan menderita. Jika ini masalahnya, pertimbangkan untuk memindahkan aplikasi ini ke mesin lain dan menggunakan mesin khusus untuk SQL Server saja. Jika ini tidak terjadi, atau tidak dapat dilakukan, pertimbangkan untuk memindahkan beberapa file ke disk atau database arsip mesin lainnya, database dan Backup log transaksi, menggunakan disk yang lebih cepat, atau menambahkan disk tambahan ke array Disk Read Time dan Disk Write Time Disk Read Time dan Disk Write Time metrics mirip dengan Disk Time. Hanya menunjukkan operasi dibaca dari atau ditulis ke disk, masing-masing. Mereka sebenarnya adalah Average Disk Read Queue Length dan Average Disk Write Queue Length values ​​yang disajikan dalam persen. Nilai yang ditunjukkan oleh metrik ini sama-sama menyesatkan seperti Disk Time Pada sistem tiga disk array, jika satu disk membaca 50 waktu (Disk Read Time 50), yang lainnya berbunyi 85 pada saat itu, dan yang ketiga tidak berfungsi, Disk Read Time adalah 135 dan Average Disk Read Queue Length 1.35. Sekilas, Disk Read Time sama dengan 135 terlihat seperti masalah, tapi tidak. Ini tidak berarti bahwa disk sibuk dari waktu. Untuk mendapatkan nilai sebenarnya, Anda harus membagi nilainya dengan jumlah disk dan Anda akan mendapatkan 1363 45, yang mengindikasikan kinerja normal Idle Time Disk tidak berfungsi saat tidak memproses permintaan baca dan tulis. Ini mengukur persentase waktu disk tidak aktif. Selama interval sampel. Jika counter ini turun di bawah 20 persen, sistem disk jenuh. Anda dapat mempertimbangkan untuk mengganti sistem disk saat ini dengan sistem disk yang lebih cepat. 3 Jika nilainya lebih rendah dari 20, disk tidak dapat melayani semua permintaan baca dan tulis secara tepat waktu. Sebelum memilih penggantian disk, periksa apakah mungkin untuk menghapus beberapa aplikasi ke mesin lain Ruang Bebas Selain Monitor Kinerja Windows, metrik ini tersedia di Windows Explorer di tab Disk dan komputer. Sementara Monitor Kinerja menunjukkan persentase ruang disk kosong yang tersedia, Windows Explorer menunjukkan jumlah di GB Ini mengukur persentase ruang kosong pada disk drive logis yang dipilih. Catat jika ini turun di bawah 15 persen, karena Anda berisiko kehabisan ruang kosong untuk OS untuk menyimpan file penting. Salah satu solusi yang jelas di sini adalah menambahkan lebih banyak ruang disk. 3 Jika nilainya menunjukkan puncak yang mendadak tanpa alasan yang jelas, diperlukan penyelidikan lebih lanjut Tidak seperti kebanyakan metrik kinerja prosesor dan memori SQL Server, metrik disk bisa sangat menipu. Mereka mungkin tidak secara jelas menunjukkan masalah kinerja nilai mereka mungkin baik-baik saja, padahal sebenarnya ada masalah disk yang serius, sementara nilai anehnya mungkin menunjukkan kinerja normal, karena menampilkan nilai untuk array disk. Kemudian sampai pada metrik array, pengetahuan konfigurasi perangkat keras diperlukan untuk membacanya dengan benar. Meskipun kekurangan metrik disk ini, mereka diperlukan untuk mengatasi masalah kinerja SQL ServerPostgreSQL vs. MS SQL Server 0. Apa ini semua tentang saya bekerja sebagai analis data di perusahaan layanan profesional global (yang sudah pasti Anda dengar). Saya telah melakukan ini selama sekitar satu dekade. Saya telah menghabiskan dekade itu untuk menangani data, perangkat lunak database, perangkat keras database, pengguna database, pemrogram database dan metode analisis data, jadi saya tahu sedikit tentang hal-hal ini. Saya sering berhubungan dengan orang-orang yang tahu sedikit tentang hal-hal ini ndash meskipun beberapa dari mereka tidak menyadarinya. Selama bertahun-tahun saya telah membahas masalah PostgreSQL vs MS SQL Server berkali-kali. Prinsip yang terkenal di IT mengatakan: jika Anda melakukannya lebih dari satu kali, otomatiskan itu. Dokumen ini adalah cara saya mengotomatisasi percakapan itu. Kecuali dinyatakan lain, saya mengacu pada PostgreSQL 9.3 dan MS SQL Server 2014, walaupun pengalaman saya dengan MS SQL Server adalah dengan versi 2008 R2 dan 2012 ndash demi keadilan dan relevansi Saya ingin membandingkan versi terbaru dari PostgreSQL sampai yang terbaru. Versi MS SQL Server Di mana saya telah membuat klaim tentang MS SQL Server, saya telah melakukan yang terbaik untuk memastikan penerapannya pada versi 2014 dengan berkonsultasi dengan dokumentasi Microsoft sendiri ndash walaupun, untuk alasan yang akan saya dapatkan. Saya juga harus sangat bergantung pada Google, Stack Overflow dan pengguna internet. Saya tahu itu tidak secara ilmiah sangat ketat untuk melakukan perbandingan seperti ini ketika saya tidak memiliki pengalaman yang sama dengan kedua database, tapi ini bukan latihan akademis yang membandingkan perbandingan dunia nyata. Saya telah melakukan yang jujur ​​terbaik untuk mendapatkan fakta saya tentang MS SQL Server ndash yang benar, kita semua tahu tidak mungkin mengoceh seluruh internet. Jika saya tahu bahwa saya salah, saya memperbaikinya. Saya membandingkan dua database dari sudut pandang seorang analis data. Mungkin MS SQL Server menendang postgreSQLs sebagai backend OLTP (walaupun saya meragukannya), tapi bukan itu yang saya tulis di sini, karena saya bukan pengembang OLTPDBAsysadmin. Akhirnya, ada alamat email di kanan atas. Silakan gunakan itu jika Anda ingin saya akan melakukan yang terbaik untuk menanggapi. DISCLAIMER: semua pendapat subjektif di sini benar-benar milik saya sendiri. 1. Mengapa PostgreSQL berjalan, jauh lebih baik daripada MS SQL Server Oops, peringatan spoiler. Bagian ini merupakan perbandingan dua database dalam hal fitur yang relevan dengan analisis data. 1.1. CSV mendukung CSV adalah cara standar de facto untuk memindahkan data terstruktur (yaitu tabular). Semua RDBMS dapat membuang data ke dalam format proprietary yang tidak dapat dibaca lagi, yang baik untuk backup, replikasi dan sejenisnya, namun sama sekali tidak digunakan untuk memigrasikan data dari sistem X ke sistem Y. Platform analisis data harus dapat dilihat Pada data dari berbagai macam sistem dan menghasilkan keluaran yang dapat dibaca oleh berbagai macam sistem. Dalam prakteknya, ini berarti bahwa ia harus dapat menelan dan mengekskresikan CSV dengan cepat, andal, berulang dan tanpa rasa sakit. Mari kita tidak mengecilkan ini: platform analisis data yang tidak dapat menangani CSV dengan kokoh adalah tanggung jawab yang rusak dan tidak berguna. Dukungan CSV PostgreSQL adalah kedudukan tertinggi. Perintah COPY TO dan COPY FROM mendukung spesifikasi yang digariskan di RFC4180 (yang merupakan hal yang paling dekat dengan standar CSV resmi) serta varian dan dialek umum dan tidak biasa. Perintah ini cepat dan kuat. Saat terjadi kesalahan, mereka memberi pesan kesalahan yang bermanfaat. Yang penting, mereka tidak akan diam-diam melakukan korupsi, salah paham atau mengubah data. Jika PostgreSQL mengatakan bahwa impor Anda berhasil, maka itu bekerja dengan baik. Sedikit bau masalah dan mengabaikan impor dan melempar pesan kesalahan yang bermanfaat. (Ini mungkin terdengar rewel atau merepotkan, tapi sebenarnya ini adalah contoh prinsip desain yang mapan. Masuk akal: lebih baik Anda tahu impor Anda salah sekarang, atau sebulan dari sekarang ketika klien Anda mengeluh bahwa hasil Anda adalah Off) MS SQL Server tidak dapat mengimpor atau mengekspor CSV. Kebanyakan orang tidak mempercayai saya saat saya menceritakannya pada mereka. Kemudian, pada titik tertentu, mereka melihat sendiri. Biasanya mereka mengamati sesuatu seperti: MS SQL Server diam-diam memotong bidang teks MS SQL Server menangani pengkodean teks yang salah MS SQL Server melemparkan pesan kesalahan karena tidak mengerti mengutip atau melarikan diri (bertentangan dengan kepercayaan populer, mengutip dan melarikan diri bukanlah ekstensi eksotis untuk CSV Mereka adalah konsep dasar secara harfiah setiap spesifikasi data serialisasi yang dapat dibaca oleh manusia. Jangan percaya siapa pun yang tidak tahu apa ini) MS SQL Server mengekspor dokumen CSV Microsoft yang tidak berguna. Bagaimana mereka bisa mengelompokan sesuatu yang sesederhana CSV Ini sangat membingungkan karena parser CSV sepele mudah untuk menulis (saya menulis satu di C dan memasukkannya ke PHP satu atau dua tahun yang lalu, karena saya tidak bahagia dengan penanganan CSV aslinya. Semua hal itu mungkin membutuhkan 100 baris kode dan tiga jam ndash dua di antaranya dihabiskan untuk mengatasi dengan SWIG yang baru bagi saya saat itu). Jika Anda tidak mempercayai saya, unduh file CSF UTF-8 yang diformat dengan benar, sesuai standar dan gunakan MS SQL Server untuk menghitung panjang string rata-rata (yaitu jumlah karakter) dari kolom terakhir pada file ini (memiliki 50 kolom) . Ayo, coba saja. (Jawaban yang Anda cari sebenarnya adalah 183.895.) Tentu, menentukan hal ini sepele mudah dalam PostgreSQL ndash sebenarnya, bit yang paling banyak memakan waktu adalah membuat tabel dengan 50 kolom untuk menyimpan datanya. Kurangnya pemahaman tentang CSV tampaknya endemik di Microsoft bahwa file akan memecahkan Access dan Excel juga. Sedih tapi benar: beberapa programmer database saya tahu baru-baru ini menghabiskan banyak waktu dan usaha menulis kode Python yang sanitises CSV untuk memungkinkan MS SQL Server untuk mengimpornya. Mereka werent mampu menghindari perubahan data aktual dalam proses ini. Ini sama gilanya dengan menghabiskan banyak uang di Photoshop dan kemudian harus menulis beberapa kode kustom untuk mendapatkannya untuk membuka JPEG, hanya untuk menemukan bahwa gambar telah sedikit berubah. 1.2. Ergonomi Setiap platform analisis data yang layak disebut adalah Turing yang lengkap, yang berarti, memberi atau menerima, bahwa salah satu dari mereka dapat melakukan apapun yang dapat dilakukan orang lain. Tidak ada hal seperti yang dapat Anda lakukan X di perangkat lunak A tapi Anda tidak dapat melakukan X di perangkat lunak B. Anda dapat melakukan apapun dalam segala hal yang berbeda-beda adalah seberapa sulitnya. Alat yang bagus membuat hal-hal yang Anda butuhkan untuk melakukan alat miskin yang mudah membuat mereka sulit. Thats apa yang selalu bermuara pada. (Ini semua benar secara konseptual, jika tidak benar - misalnya, tidak ada RDBMS yang saya tahu bisa menghasilkan grafis 3D. Tetapi salah satu dari mereka dapat meniru perhitungan apapun yang bisa dilakukan GPU.) PostgreSQL ditulis dengan jelas oleh orang-orang yang benar-benar peduli dengan Menyelesaikan pekerjaan MS SQL Server terasa seperti ditulis oleh orang-orang yang tidak pernah harus benar-benar menggunakan MS SQL Server untuk mencapai apapun. Berikut adalah beberapa contoh untuk mendukungnya: PostgreSQL mendukung DROP TABLE IF EXISTS. Yang merupakan cara yang cerdas dan jelas untuk mengatakan jika tabel ini tidak ada, tidak melakukan apapun, tapi jika memang demikian, singkirkanlah itu. Sesuatu seperti ini: Heres bagaimana Anda harus melakukannya di MS SQL Server: Ya, hanya satu baris kode tambahan, namun perhatikan parameter kedua yang misterius pada fungsi OBJECTID. Anda perlu mengganti dengan NV untuk menjatuhkan tampilan. NP-nya untuk prosedur tersimpan. Saya havent belajar semua huruf yang berbeda untuk semua jenis objek database (mengapa harus saya harus) Perhatikan juga bahwa nama tabel diulang tidak perlu. Jika konsentrasi Anda tergelincir sejenak, orang mati mudah melakukan ini: Lihatlah apa yang terjadi di sana Ini adalah sumber kesalahan yang menyebalkan dan menyia-nyiakan waktu yang berharga. PostgreSQL mendukung DROP SCHEMA CASCADE. Yang menjatuhkan skema dan semua objek database di dalamnya. Ini sangat, sangat penting bagi metodologi pengiriman analisis yang kuat, di mana tear-down-and-rebuild adalah prinsip dasar kerja analisis yang berulang, dapat diaudit dan kolaboratif. Tidak ada fasilitas seperti itu di MS SQL Server. Anda harus menjatuhkan semua objek dalam skema secara manual, dan dalam urutan yang benar. Karena jika Anda mencoba menjatuhkan objek yang menjadi objek lain, MS SQL Server hanya melempar kesalahan. Ini memberi gambaran betapa rumitnya proses ini. PostgreSQL mendukung CREATE TABLE AS. Contoh wee: Ini berarti Anda dapat menyoroti semuanya kecuali baris pertama dan menjalankannya, yang merupakan tugas yang berguna dan umum saat mengembangkan kode SQL. Di MS SQL Server, pembuatan tabel berjalan seperti ini: Jadi, untuk mengeksekusi pernyataan SELECT biasa, Anda harus memberi komentar atau menghapus bit INTO. Ya, komentar dua baris itu mudah bukan intinya. Intinya adalah bahwa di PostgreSQL Anda dapat melakukan tugas sederhana ini tanpa memodifikasi kode dan di MS SQL Server Anda tidak dapat, dan itu mengenalkan sumber bug dan gangguan lain yang potensial. Di PostgreSQL, Anda dapat mengeksekusi sebanyak mungkin pernyataan SQL yang Anda inginkan dalam satu batch selama Anda mengakhiri setiap pernyataan dengan titik koma, Anda dapat mengeksekusi kombinasi pernyataan apa pun yang Anda sukai. Untuk menjalankan proses batch otomatis atau data berulang yang membangun atau tugas keluaran, ini adalah fungsi yang sangat penting. Di MS SQL Server, pernyataan CREATE PROCEDURE tidak dapat muncul di tengah serangkaian pernyataan SQL. Tidak ada alasan bagus untuk ini, itu hanya batasan yang sewenang-wenang. Ini berarti bahwa langkah-langkah manual tambahan sering diperlukan untuk menjalankan batch SQL yang besar. Langkah manual meningkatkan risiko dan mengurangi efisiensi. PostgreSQL mendukung klausul RETURNING, memungkinkan UPDATE. INSERT dan DELETE statement untuk mengembalikan nilai dari baris yang terpengaruh. Ini elegan dan berguna. MS SQL Server memiliki klausa OUTPUT, yang membutuhkan definisi variabel tabel terpisah untuk fungsi. Ini kikuk dan merepotkan dan memaksa programmer membuat dan memelihara kode boilerplate yang tidak perlu. PostgreSQL mendukung string quoting, seperti: Ini sangat berguna untuk menghasilkan SQL dinamis karena (a) memungkinkan pengguna untuk menghindari penggandaan manual yang membosankan dan tidak dapat diandalkan dan melarikan diri saat string literal disarangkan dan (b) karena editor teks dan IDE cenderung tidak Recogniise sebagai pembatas string, penyorotan sintaks tetap fungsional bahkan dalam kode SQL dinamis. PostgreSQL memungkinkan Anda menggunakan bahasa prosedural hanya dengan mengirimkan kode ke mesin database Anda menulis kode prosedural dengan Python atau Perl atau R atau JavaScript atau bahasa lain yang didukung (lihat di bawah) tepat di samping SQL Anda, dalam naskah yang sama. Ini nyaman, cepat, mudah perawatan, mudah ditinjau ulang, mudah digunakan kembali dan sebagainya. Di MS SQL Server, Anda bisa menggunakan bahasa prosedural T-SQL yang kental, lamban, canggung, atau Anda dapat menggunakan bahasa untuk membuat perakitan dan memasukkannya ke dalam database. Ini berarti kode Anda ada dua tempat terpisah dan Anda harus melalui serangkaian langkah manual berbasis GUI untuk mengubahnya. Itu membuat kemasan semua barang Anda menjadi satu tempat lebih keras dan lebih rawan kesalahan. Dan ada banyak contoh di luar sana. Masing-masing hal ini, dalam isolasi, mungkin tampak seperti niggle yang relatif kecil namun, efek keseluruhannya adalah bahwa mendapatkan pekerjaan nyata yang dilakukan di MS SQL Server secara signifikan lebih sulit dan lebih rentan terhadap kesalahan daripada di PostgreSQL, dan analis data menghabiskan waktu dan energi yang berharga. Pada workarounds dan proses manual alih-alih berfokus pada masalah sebenarnya. Update: itu menunjukkan kepada saya bahwa satu fitur yang sangat berguna MS SQL Server yang kekurangan PostgreSQL adalah kemampuan untuk mendeklarasikan variabel dalam skrip SQL. Seperti ini: PostgreSQL tidak bisa melakukan ini. Saya berharap bisa, karena ada banyak penggunaan untuk fitur seperti itu. 1.3. Anda bisa menjalankan PostgreSQL di Linux, BSD dll (dan tentu saja Windows) Siapa pun yang mengikuti perkembangan di IT tahu bahwa cross-platform adalah sesuatu sekarang. Dukungan cross-platform bisa dibilang merupakan fitur pembunuh di Jawa, yang sebenarnya merupakan bahasa pemrograman yang agak kacau dan jelek, namun tetap sukses, berpengaruh dan meluas. Microsoft tidak lagi memiliki monopoli yang pernah dinikmati di desktop, berkat bangkitnya Linux dan Apple. Infrastruktur TI semakin heterogen berkat fleksibilitas layanan cloud dan akses mudah ke teknologi virtualisasi performa tinggi. Perangkat lunak lintas platform adalah tentang memberi kontrol pengguna atas infrastruktur mereka. (Saat bekerja saat ini saya mengelola beberapa database PostgreSQL, beberapa di Windows dan beberapa di Ubuntu Linux.Saya dan rekan-rekan saya dengan bebas memindahkan kode dan dump database di antara mereka.Kami menggunakan Python dan PHP karena mereka juga bekerja di kedua sistem operasi. .) Kebijakan Microsoft dan selalu menjadi vendor lock-in. Mereka tidak membuka sumber kode mereka, mereka tidak menyediakan versi cross-platform dari perangkat lunak mereka, mereka bahkan menemukan keseluruhan ekosistem. NET, dirancang untuk menarik garis keras antara pengguna Microsoft dan pengguna non-Microsoft. Ini bagus untuk mereka, karena ini melindungi pendapatan mereka. Ini buruk bagi Anda, pengguna, karena membatasi pilihan Anda dan menciptakan pekerjaan yang tidak perlu untuk Anda. (Update: beberapa hari setelah saya menerbitkan ini, Microsoft membuat saya terlihat seperti prat dengan mengumumkan bahwa itu adalah open-sourcing. Ini adalah langkah bagus, tapi mari kita tidak membuka Bollinger dulu.) Sekarang, ini bukan Dokumen Linux vs Windows, walaupun saya yakin akhirnya akan menulis salah satu dari mereka di beberapa titik. Cukup dengan mengatakan bahwa, untuk pekerjaan TI yang sebenarnya, Linux (dan keluarga mirip UNIX: Solaris, BSD dll) meninggalkan Windows di debu. Sistem operasi mirip UNIX mendominasi pasar server, layanan awan, superkomputer (dalam bidang ini monopoli hampir) dan komputasi teknis, dan dengan alasan bagus, sistem ini dirancang oleh teknisi untuk teknisi. Akibatnya, mereka menukar keramahan pengguna dengan kekuatan dan fleksibilitas yang luar biasa. OS mirip UNIX yang tepat bukan hanya sebuah perintah yang bagus ndash itu adalah ekosistem program, utilitas, fungsionalitas dan dukungan yang membuat pekerjaan nyata berjalan dengan efisien dan menyenangkan. Seorang hacker Linux yang kompeten dapat mencapainya dalam satu lemparan tunggal dari skrip Bash tugas yang akan sulit dan menyita waktu di Windows. (Contoh: beberapa hari yang lalu saya melihat-lihat koleksi film teman-teman dan dia bilang menurutnya jumlah file dalam sistem file tinggi, mengingat berapa banyak film yang dimilikinya, dan dia bertanya-tanya apakah mungkin dia sengaja menyalin folder besar Struktur ke dalam salah satu folder filmnya.Aku menghitung rekursif file-per-folder untuknya seperti ini: Semuanya butuh waktu sekitar satu menit untuk menulis dan yang kedua untuk dijalankan.Ini menegaskan bahwa beberapa foldernya bermasalah dan Memberitahu yang mana mereka Bagaimana Anda melakukan ini di Windows) Untuk analisis data, RDBMS tidak ada dalam ruang hampa, ini adalah bagian dari tumpukan alat. Oleh karena itu lingkungannya penting. MS SQL Server terbatas pada Windows, dan Windows hanyalah lingkungan analisis yang buruk. 1.4. Fitur bahasa prosedural Ini adalah masalah besar. SQL deklaratif murni bagus dalam hal ini dirancang untuk manipulasi data kuasi ndash dan query. Anda dengan cepat mencapai batasnya jika Anda mencoba menggunakannya untuk proses analitis yang lebih terlibat, seperti perhitungan minat yang kompleks, analisis deret waktu dan perancangan algoritma umum. Penyedia database SQL mengetahui hal ini, jadi hampir semua database SQL menerapkan beberapa jenis bahasa prosedural. Hal ini memungkinkan pengguna database untuk menulis kode gaya imperatif untuk tugas yang lebih kompleks atau fiddly. Dukungan bahasa prosedural PostgreSQL luar biasa. Tidak mungkin untuk melakukan keadilan untuk itu dalam ruang yang singkat, tapi Heres sampel barang. Salah satu dari bahasa prosedural ini dapat digunakan untuk menulis prosedur dan fungsi yang tersimpan atau hanya dimasukkan ke dalam blok kode yang akan dijalankan secara inline. PLPGSQL: ini adalah bahasa prosedural PostgreSQL. Its seperti Oracles PLSQL, tapi lebih modern dan lengkap fitur. PLV8: mesin JavaScript V8 dari Google Chrome tersedia di PostgreSQL. Mesin ini stabil, penuh fitur dan tidak kepalang cepat ndash sering mendekati kecepatan eksekusi yang dikompilasi, dioptimalkan C. Kombinasikan dengan dukungan asli PostgreSQL untuk tipe data JSON (lihat di bawah) dan Anda memiliki kekuatan dan fleksibilitas maksimal dalam satu paket. Lebih baik lagi, PLV8 mendukung status global (yaitu fungsi cross-function call), yang memungkinkan pengguna untuk menyeleksi data cache secara selektif dalam RAM untuk akses acak cepat. Misalkan Anda perlu menggunakan 100.000 baris data dari tabel A pada masing-masing 1.000.000 baris data dari tabel B. Di SQL biasa, Anda harus bergabung dengan tabel ini (menghasilkan tabel antara baris 100bn, yang akan membunuh yang manapun tapi yang paling banyak Server besar) atau melakukan sesuatu yang mirip dengan subkueri skalar (atau lebih buruk lagi, loop nested berbasis kursor), mengakibatkan beban IO yang melumpuhkan jika perencana kueri tidak membacakan niat Anda dengan benar. Dalam PLV8 Anda cukup meng-cache tabel A di memori dan menjalankan fungsi pada masing-masing baris tabel B ndash yang berlaku memberi Anda akses berkualitas RAM (latensi yang diabaikan dan hukuman akses acak tidak ada beban IO yang tidak mudah menguap) ke tabel baris 100k . Saya melakukan ini pada bagian pekerjaan yang sebenarnya baru-baru ini menunjukkan kode PostgreSQLPLV8 saya sekitar 80 kali lebih cepat daripada solusi MS T-SQL dan kodenya jauh lebih kecil dan lebih mudah dipertahankan. Karena butuh waktu sekitar 23 detik, bukan setengah jam untuk berjalan, saya dapat menjalankan 20 siklus uji coba dalam satu jam, menghasilkan kode bebas bug yang lengkap, benar teruji. Lihat di sini untuk detail lebih lanjut tentang ini. (Semua siklus run-test-modify hanya dimungkinkan karena DROP SCHEMA CASCADE dan kebebasan untuk mengeksekusi pernyataan CREATE FUNCTION di tengah batch pernyataan, seperti yang dijelaskan di atas. Lihat seberapa baik semuanya sesuai) PLPython: Anda dapat menggunakan penuh Python di PostgreSQL Python2 atau Python 3, pilihlah, dan ya, Anda mendapatkan ekosistem perpustakaan yang sangat besar yang menurutnya sangat terkenal oleh Python. Fancy menjalankan SVM dari scikit-belajar atau beberapa aritmatika presisi sewenang-wenang yang disediakan oleh gmpy2 di tengah kueri SQL Tidak ada masalah PLPerl: Perl telah jatuh dari mode untuk beberapa waktu, namun versinya menjadikannya sebagai reputasi sebagai tentara Swiss. Pisau bahasa pemrograman Di PostgreSQL Anda memiliki Perl penuh sebagai bahasa prosedural. PLR: R adalah lingkungan pemrograman statistika standar de facto di dunia akademis dan sains data, dan dengan alasan yang bagus - fitur ini bebas, kuat, lengkap dan didukung oleh perpustakaan plugin dan add-on berkualitas tinggi. PostgreSQL memungkinkan Anda menggunakan R sebagai bahasa prosedural. Java, Lua, sh, Tcl, Ruby dan PHP juga didukung sebagai bahasa prosedural dalam PostgreSQL. C: tidak termasuk dalam daftar ini karena Anda harus mengkompilasinya secara terpisah, namun layak disebutkan. Di PostgreSQL sangat mudah untuk membuat fungsi yang dijalankan, dikompilasi, dioptimalkan C (atau C atau assembler) di database backend. Ini adalah fitur pengguna daya yang memberikan kecepatan dan kontrol memori dan penggunaan sumber daya yang tak tertandingi untuk tugas di mana kinerja sangat penting. Saya telah menggunakan ini untuk menerapkan algoritma pemrosesan pembayaran yang kompleks dan stateful yang beroperasi pada sejuta baris data per detik ndash dan itu ada di PC desktop. MS SQL Server inbuilt bahasa prosedural (bagian dari ekstensi T-SQL mereka ke SQL) kikuk, lamban dan miskin fitur. Hal ini juga rentan terhadap kesalahan dan bug yang tidak kentara, seperti dokumentasi Microsoft sendiri kadang-kadang mengakui. Saya belum pernah bertemu pengguna database yang menyukai bahasa prosedural T-SQL. Bagaimana dengan fakta bahwa Anda dapat membuat rakitan dalam bahasa dan kemudian menggunakannya di MS SQL Server Ini tidak dihitung sebagai dukungan bahasa prosedural karena Anda tidak dapat mengirimkan kode ini ke mesin database secara langsung. Pengelolaan dan ergonomi sangat penting. Memasukkan beberapa kode Python secara inline dalam query database Anda mudah dilakukan dan mudah dipecat sampai Visual Studio, mengelola proyek dan membuang file DLL di sekitar (semua dalam proses berbasis GUI yang tidak dapat ditulis dengan benar, dikontrol, diotomatiskan atau diperiksa) canggung, kesalahan -pengaturan dan tidak terukur. Bagaimanapun, mekanisme ini terbatas pada bahasa. 1.5. Dukungan regular regular expression Regular expressons (regexen atau regexes) sangat penting untuk analisis bekerja sebagai aritmatika ndash mereka adalah pilihan pertama (dan seringkali hanya pilihan) untuk berbagai macam tugas pemrosesan teks. Alat analisis data tanpa dukungan regex seperti sepeda tanpa ndash pelana Anda tetap bisa menggunakannya, tapi sangat menyakitkan. PostgreSQL telah menghancurkan dukungan out-of-the-box untuk regex. Beberapa contoh: Dapatkan semua baris yang dimulai dengan angka yang diulang diikuti dengan vokal: Dapatkan string hex terisolasi yang pertama yang terjadi di lapangan: Break string di spasi dan kembalikan setiap fragmen di baris terpisah: Case-insensitive menemukan semua kata dalam sebuah string Dengan setidaknya 10 huruf: MS SQL Server memiliki LIKE. SUBSTRING PATINDEX dan sebagainya, yang tidak sebanding dengan dukungan regex yang tepat (jika Anda meragukannya, cobalah menerapkan contoh di atas dengan menggunakannya). Ada perpustakaan regex pihak ketiga untuk MS SQL Server yang sama sekali tidak sebagus dukungan PostgreSQL, dan kebutuhan untuk mendapatkan dan memasangnya secara terpisah menambahkan admin overhead. Perhatikan juga bahwa dukungan bahasa prosedural PostgreSQL juga memberi Anda beberapa mesin regex dan berbagai fitur - mis. Pythons regex library memberikan kekuatan tambahan dari pernyataan positif dan negatif yang terlihat. Hal ini sesuai dengan tema umum PostgreSQL yang memberi Anda semua alat yang Anda butuhkan untuk menyelesaikan semuanya. 1.6. Custom agregat fungsi Ini adalah fitur yang, secara teknis, ditawarkan oleh PostgreSQL dan MS SQL Server. Implementasinya sangat berbeda. Di PostgreSQL, agregat khusus mudah digunakan dan mudah digunakan, menghasilkan kode pemecahan masalah dan kode yang cepat: Elegan, eh Suatu agregat khusus ditentukan dalam bentuk keadaan internal dan cara untuk memodifikasi keadaan itu saat kita mendorong nilai baru ke dalam Fungsi agregat. Dalam hal ini, kita memulai setiap pelanggan dengan nol keseimbangan dan tidak ada bunga yang terakumulasi, dan setiap hari kita memperoleh bunga secara tepat dan memperhitungkan pembayaran dan penarikan. Kami menggabungkan minat pada tanggal 1 setiap bulannya. Perhatikan bahwa agregat menerima klausa ORDER BY (karena, tidak seperti SUM. MAX dan MIN, agregat ini bergantung pada pesanan) dan PostgreSQL menyediakan operator untuk mengekstraksi nilai dari objek JSON. Jadi, dalam 28 baris kode, kami menciptakan kerangka untuk menarik uang majemuk bulanan di rekening bank dan menggunakannya untuk menghitung saldo akhir. Jika fitur ditambahkan ke metodologi (misalnya modifikasi tingkat suku bunga tergantung pada saldo kredit debet, deteksi keadaan luar biasa), semuanya ada di sana dalam fungsi transisi dan ditulis dalam bahasa yang sesuai untuk menerapkan logika yang kompleks. (Tragis sisi catatan: Saya telah melihat organisasi besar menghabiskan puluhan ribu pound selama berminggu-minggu bekerja untuk mencapai hal yang sama dengan menggunakan alat yang lebih buruk.) MS SQL Server, sebaliknya, membuatnya sangat sulit. Kebetulan, contoh di link kedua adalah untuk menerapkan gabungan rangkaian gabungan sederhana. Perhatikan jumlah besar kode dan senam yang dibutuhkan untuk menerapkan fungsi sederhana ini (yang disediakan oleh PostgreSQL di luar kotak, mungkin karena berguna). MS SQL Server juga tidak mengizinkan perintah untuk ditentukan secara agregat, yang membuat fungsi ini tidak berguna untuk jenis pekerjaan saya dengan MS SQL Server, urutan rangkaian string acak, sehingga hasil query menggunakan fungsi ini adalah Non-deterministik (mereka mungkin berubah dari run to run) dan kodenya tidak akan lulus review kualitas. Kurangnya dukungan pemesanan juga melanggar kode seperti contoh perhitungan bunga di atas. As far as I can tell, you just cant do this using an MS SQL Server custom aggregate. (It is actually possible to make MS SQL Server do a deterministic string concatenation aggregation in pure SQL but you have to abuse the RECURSIVE query functionality to do it. Although an interesting academic exercise, this results in slow, unreadable, unmaintainable code and is not a real-world solution). 1.7. Unicode support Long gone are the days when ASCII was universal, character and byte were fungible terms and foreign (from an Anglocentric standpoint) text was an exotic exception. Proper international language support is no longer optional. The solution to all this is Unicode. There are a lot of misconceptions about Unicode out there. Its not a character set, its not a code page, its not a file format and its nothing whatsoever to do with encryption. An exploration of how Unicode works is fascinating but beyond the scope of this document ndash I heartily recommend Googling it and working through a few examples. The key points about Unicode that are relevant to database functionality are: Unicode-encoded text (for our purposes this means either UTF-8 or UTF-16) is a variable-width encoding. In UTF-8 a character can take one, two, three or four bytes to represent. In UTF-16 its either two or four. This means that operations like taking substrings and measuring string lengths need to be Unicode-aware to work properly. Not all sequences of bytes are valid Unicode. Manipulating valid Unicode without knowing its Unicode is likely to produce something that is not valid Unicode. UTF-8 and UTF-16 are not compatible. If you take one file of each type and concatenate them, you (probably) end up with a file which is neither valid UTF-8 nor valid UTF-16. For text which mostly fits into ASCII, UTF-8 is about twice as space-efficient as UTF-16. PostgreSQL supports UTF-8. Its CHAR. VARCHAR and TEXT types are, by default, UTF-8, meaning they will only accept UTF-8 data and all the transformations applied to them, from string concatenation and searching to regular expressions, are UTF-8-aware. It all just works. MS SQL Server 2008 does not support UTF-16 it supports UCS-2, a deprecated subset of UTF-16. What this means is that most of the time, it will look like its working fine, and occasionally, it will silently corrupt your data. Since it interprets text as a string of wide (i.e. 2-byte) characters, it will happily cut a 4-byte UTF-16 character in half. At best, this results in corrupted data. At worst, something else in your toolchain will break badly and youll have a disaster on your hands. Apologists for MS are quick to point out that this is unlikely because it would require the data to contain something outside Unicodes basic multilingual plane. This is completely missing the point. A databases sole purpose is storing, retreiving and manipulating data. A database which can be broken by putting the wrong data in it is as useless as a router that breaks if you download the wrong file. MS SQL Server versions since 2012 have supported UTF-16 properly, if you ensure you select a UTF-16-compliant collation for your database. It is baffling that this is (a) optional and (b) implemented as late as 2012. Better late than never, I suppose. 1.8. Data types that work properly A common misconception is that all databases have the same types ndash INT. CHAR. DATE and so on. This is not true. PostgreSQLs type system is really useful and intuitive, free of annoyances which introduce bugs or slow work down and, as usual, apparently designed with productivity in mind. MS SQL Servers type system, by comparison, feels like beta software. It cant touch the feature set of PostgreSQLs type system and it is beset with traps waiting to ensnare the unwary user. Lets take a look: CHAR, VARCHAR and family PostgreSQL: the docs actively encourage you to simply use the TEXT type. This is a high-performance, UTF-8 validated text storage type which stores strings up to 1GB in size. It supports all the text operations PostgreSQL is capable of: simple concatenation and substringing regex searching, matching and splitting full-text search casting character transformation and so on. If you have text data, stick it in a TEXT field and carry on. Moreover, since anything in a TEXT field (or, for that matter, CHAR or VARCHAR fields) must be UTF-8, there is no issue with encoding incompatibility. Since UTF-8 is the de facto universal text encoding, converting text to it is easy and reliable. Since UTF-8 is a superset of ASCII, this conversion is often trivially easy or altogether unnecessary. It all just works. MS SQL Server: its a pretty sad story. The TEXT and NTEXT types exist and stretch to 2GB. Bafflingly, though, they dont support casting. Also, dont use them, says MS ndash they will be removed in a future version of MS SQL Server. You should use CHAR. VARCHAR and their N -prefixed versions instead. Unfortunately, VARCHAR(MAX) has poor performance characteristics and VARCHAR(8000) (the next biggest size, for some reason) tops out at 8,000 bytes. (Its 4,000 characters for NVARCHAR .) Remember how PostgreSQLs insistence on a single text encoding per database makes everything work smoothly Not so in MS-land: As with earlier versions of SQL Server, data loss during code page translations is not reported. link In other words, MS SQL Server might corrupt your data, and you wont know about it until something else goes wrong. This is, quite simply, a deal-breaker. A data analytics platform which might silently change, corrupt or lose your data is an enormous liability. Consider the absurdity of forking out for a server using expensive ECC RAM as a defence against data corruption caused by cosmic rays, and then running software on it which might corrupt your data anyway. Date and time types PostgreSQL: you get DATE. TIME. TIMESTAMP and TIMESTAMP WITH TIME ZONE. all of which do exactly what you would expect. They also have fantastic range and precision, supporting microsecond resolution from the 5th millennium BC to almost 300 millennia in the future. They accept input in a wide variety of formats and the last one has full support for time zones. They can be converted to and from Unix time, which is very important for interoperability with other systems. They can take the special values infinity and -infinity. This is not a metaphysico-theologico-philosophical statement, but a hugely useful semantic construction. For example, set a users password expiry date to infinity to denote that they do not have to change their password. The standard way of doing this is to use NULL or some date far in the future, but these are clumsy hacks ndash they both involve putting inaccurate information in the database and writing application logic to compensate. What happens when a developer sees NULL or 3499-12-31. If youre lucky, he knows the secret handshakes and isnt confused by it. If not, he assumes either that the date is unknown or that it really does refer to the 4th millennium, and you have a problem. The cumulative effect of hacks, workarounds and kludges like this is unreliable systems, unhappy programmers and increased business risk. Helpful semantics like infinity and -infinity allow you to say what you mean and write consistent, readable application logic. They also support the INTERVAL type, which is so useful it has its own section right after this one. Casting and conversion of date and time types is easy and intuitive - you can cast any type to TEXT. and the tochar and totimestamp functions give you ultimate flexibility, allowing conversion in both directions using format strings. For example: and, going in the other direction, As usual, it just works. As a data analyst, I care very much about a databases date-handling ability, because dates and times tend to occur in a multitude of different formats and they are usually critical to the analysis itself. MS SQL Server: dates can only have positive 4-digit years, so they are restricted to 0001 AD to 9999 AD. They do not support infinity and -infinity. They do not support interval types, so date arithmetic is tedious and clunky. You can convert them to and from UNIX time, but its a hack involving adding seconds to the UNIX epoch, 1970-01-01T00:00:00Z, which you therefore have to know and be willing to hardcode into your application. Date conversion deserves a special mention, because even by MS SQL Servers shoddy standards its bloody awful. The CONVERT function takes the place of PostgreSQLs tochar and totimestamp. but it works like this: Thats right ndash youre simply expected to know that 126 is the code for converting strings in that format to a datetime. MSDN provides a table of these magic numbers. I didnt give the same example as for PostgreSQL because I couldnt find a magic number corresponding to the right format for Saturday 03 Feb 2001. If someone gave you data with such dates in it, I guess youd have to do some string manipulation (pity the string manipulation facilities in MS SQL Server are almost non-existent. ) PostgreSQL: the INTERVAL type represents a period of time, such as 30 microseconds or 50 years. It can also be negative, which may seem counterintuitive until you remember that the word ago exists. PostgreSQL also knows about ago, in fact, and will accept strings like 1 day ago as interval values (this will be internally represented as an interval of -1 days). Interval values let you do intuitive date arithmetic and store time durations as first-class data values. They work exactly as you expect and can be freely casted and converted to and from anything which makes sense. MS SQL Server: no support for interval types. PostgreSQL: arrays are supported as a first-class data type, meaning fields in tables, variables in PLPGSQL, parameters to functions and so on can be arrays. Arrays can contain any data type you like, including other arrays. This is very, very useful . Here are some of the things you can do with arrays: Store the results of function calls with arbitrarily-many return values, such as regex matches Represent a string as integer word IDs, for use in fast text matching algorithms Aggregation of multiple data values across groups, for efficient cross-tabulation Perform row operations using multiple data values without the expense of a join Accurately and semantically represent array data from other applications in your tool stack Feed array data to other applications in your tool stack I cant think of any programming languages which dont support arrays, other than crazy ones like Brainfuck and Malbolge. Arrays are so useful that they are ubiquitous. Any system, especially a data analytics platform, which doesnt support them is crippled. MS SQL Server: no support for arrays. PostgreSQL: full support for JSON, including a large set of utility functions for transforming between JSON types and tables (in both directions), retreiving values from JSON data and constructing JSON data. Parsing and stringification are handled by simple casts, which as a rule in PostgreSQL are intelligent and robust. The PLV8 procedural language works as seamlessly as you would expect with JSON ndash in fact, a JSON-type internal state in a custom aggregate (see this example) whose transition function is written in PLV8 provides a declarativeimperative best-of-both-worlds so powerful and convenient it feels like cheating. JSON (and its variants, such as JSONB) is of course the de facto standard data transfer format on the web and in several other data platforms, such as MongoDB and ElasticSearch, and in fact any system with a RESTful interface. Aspiring Analytics-as-a-Service providers take note. MS SQL Server: no support for JSON. PostgreSQL: HSTORE is a PostgreSQL extension which implements a fast key-value store as a data type. Like arrays, this is very useful because virtually every high-level programming language has such a concept (and virtually every programming language has such a concept because it is very useful). JavaScript has objects, PHP has associative arrays, Python has dicts, C has std::map and std::unorderedmap. Go has maps. And so on. In fact, the notion of a key-value store is so important and useful that there exists a whole class of NoSQL databases which use it as their main storage paradigm. Theyre called, uh, key-value stores . There are also some fun unexpected uses of such a data type. A colleague recently asked me if there was a good way to deduplicate a text array. Heres what I came up with: i.e. put the array into both the keys and values of an HSTORE, forcing a dedupe to take place (since key values are unique) then retrieve the keys from the HSTORE. Theres that PostgreSQL versatility again. MS SQL Server: No support for key-value storage. Range types PostgreSQL: range types represent, well, ranges. Every database programmer has seen fields called startdate and enddate. and most of them have had to implement logic to detect overlaps. Some have even found, the hard way, that joins to ranges using BETWEEN can go horribly wrong, for a number of reasons. PostgreSQLs approach is to treat time ranges as first-class data types. Not only can you put a range of time (or INT s or NUMERIC s or whatever) into a single data value, you can use a host of built-in operators to manipulate and query ranges safely and quickly. You can even apply specially-developed indices to them to massively accelerate queries that use these operators. In short, PostgreSQL treats ranges with the importance they deserve and gives you the tools to work with them effectively. Im trying not to make this document a mere list of links to the PostgreSQL docs, but just this once, I suggest you go and see for yourself . (Oh, and if the pre-defined types dont meet your needs, you can define your own ones. You dont have to touch the source code, the database exposes methods to allow you to do this.) MS SQL Server: no support for range types. NUMERIC and DECIMAL PostgreSQL: NUMERIC (and DECIMAL - theyre symonyms) is near-as-dammit arbitrary precision: it supports 131,072 digits before the decimal point and 16,383 digits after the decimal point. If youre running a bank, doing technical computation, landing spaceships on comets or simply doing something where you cannot tolerate rounding errors, youre covered. MS SQL Server: NUMERIC (and DECIMAL - theyre symonyms) supports a maximum of 38 decimal places of precision in total. PostgreSQL: XML is supported as a data type and the database offers a variety of functions for working with XML. Xpath querying is supported. MS SQL Server: finally, some good news MS SQL Server has an XML data type too, and offers plenty of support for working with it. (Shame XML is going out of style. ) 1.9. Scriptability PostgreSQL can be driven entirely from the command line, and since it works in operating systems with proper command lines (i.e. everything except Windows), this is highly effective and secure. You can SSH to a server and configure PostgreSQL from your mobile phone, if you have to (I have done so more than once). You can automate deployment, performance-tuning, security, admin and analytics tasks with scripts. Scripts are very important because unlike GUI processes, they can be copied, version-controlled, documented, automated, reviewed, batched and diffed. For serious work, text editors and command lines are king. MS SQL Server is driven through a GUI. I dont know to what extent it can be automated with Powershell I do know that if you Google for help and advice on getting things done in MS SQL Server, you get a lot of people saying right-click on your database, then click on Tasks. . GUIs do not work well across low-bandwidth or high-latency connections text-based shells do. As I write I am preparing to do some sysadmin on a server 3,500 miles away, on a VPN via a shaky WiFi hotspot, and thanking my lucky stars its an UbuntuPostgreSQL box. (Who on Earth wants a GUI on a server anyway) 1.10. Good external language bindings PostgreSQL is very, very easy to connect to and use from programming environments, because libpq, its external API, is very well-designed and very well-documented. This means that writing utilities which plug into PostgreSQL is very easy and convenient, which makes the database more versatile and a better fit in an analytics stack. On many occasions I have knocked up a quick program in C or C which connects to PostgreSQL, pulls some data out and does some heavy calculations on it, e.g. using multithreading or special CPU instructions - stuff the database itself is not suitable for. I have also written C programs which use setuid to allow normal users to perform certain administrative tasks in PostgreSQL. It is very handy to be able to do this quickly and neatly. MS SQL Servers external language bindings vary. Sometimes you have to install extra drivers. Sometimes you have to create classes to store the data you are querying, which means knowing at compile time what that data looks like. Most importantly, the documentation is a confusing, tangled mess, which makes getting this done unnecessarily time-consuming and painful. 1.11. Documentation Data analytics is all about being a jack of all trades. We use a very wide variety of programming languages and tools. (Off the top of my head, the programmingscripting languages I currently work with are PHP, JavaScript, Python, R, C, C, Go, three dialects of SQL, PLPGSQL and Bash.) It is hopelessly unrealistic to expect to learn everything you will need to know up front. Getting stuff done frequently depends on reading documentation. A well-documented tool is more useful and allows analysts to be more productive and produce higher-quality work. PostgreSQLs documentation is excellent. Everything is covered comprehensively but the documents are not merely reference manuals ndash they are full of examples, hints, useful advice and guidance. If you are an advanced programmer and really want to get stuck in, you can also simply read PostgreSQLs source code, all of which is openly and freely available. The docs also have a sense of humour: The first century starts at 0001-01-01 00:00:00 AD, although they did not know it at the time. This definition applies to all Gregorian calendar countries. There is no century number 0, you go from -1 century to 1 century. If you disagree with this, please write your complaint to: Pope, Cathedral Saint-Peter of Roma, Vatican. MS SQL Servers documentation is all on MSDN, which is an unfriendly, sprawling mess. Because Microsoft is a large corporation and its clients tend to be conservative and humourless, the documentation is business appropriate ndash i.e. officious, boring and dry. Not only does it lack amusing references to the historical role of Catholicism in the development of date arithmetic, it is impenetrably stuffy and hidden behind layers of unnecessary categorisation and ostentatiously capitalised official terms. Try this: go to the product documentation page for MS SQL Server 2012 and try to get from there to something useful. Or try reading this gem (not cherry-picked, I promise): A report part definition is an XML fragment of a report definition file. You create report parts by creating a report definition, and then selecting report items in the report to publish separately as report parts. Has the word report started to lose its meaning yet (And, of course, MS SQL Server is closed source, so you cant look at the source code. Yes, I know source code is not the same as documentation, but it is occasionally surprisingly useful to be able to simply grep the source for a relevant term and cast an eye over the code and the comments of the developers. Its easy to think of our tools as magical black boxes and to forget that even something as huge and complex as an RDBMS engine is, after all, just a list of instructions written by humans in a human-readable language.) 1.12. Logging thats actually useful MS SQL Servers logs are spread across several places - error logs, Windows event log, profiler logs, agent logs and setup log. To access these you need varying levels of permissions and you have to use various tools, some of which are GUI-only. Maybe things like Splunk can help to automate the gathering and parsing of these logs. I havent tried, nor do I know anyone else who has. Google searches on the topic produce surprisingly little information, surprisingly little of which is of any use. PostgreSQLs logs, by default, are all in one place. By changing a couple of settings in a text file, you can get it to log to CSV (and since were talking about PostgreSQL, its proper CSV, not broken CSV). You can easily set the logging level anywhere from dont bother logging anything to full profiling and debugging output. The documentation even contains DDL for a table into which the CSV-format logs can be conveniently imported. You can also log to stderr or the system log or to the Windows event log (provided youre running PostgreSQL in Windows, of course). The logs themselves are human-readable and machine-readable and contain data likely to be of great value to a sysadmin. Who logged in and out, at what times, and from where Which queries are being run and by whom How long are they taking How many queries are submitted in each batch Because the data is well-formatted CSV, it is trivially easy to visualise or analyse it in R or PostgreSQL itself or Pythons matplotlib or whatever you like. Overlay this with the wealth of information that Linux utilities like top, iotop and iostat provide and you have easy, reliable access to all the server telemetry you could possibly need. 1.13. Support How is PostgreSQL going to win this one Everyone knows that expensive flagship enterprise products by big commercial vendors have incredible support, whereas free software doesnt have any Of course, this is nonsense. Commercial products have support from people who support it because they are paid to. They do the minimum amount necessary to satisfy the terms of the SLA. As I type this, some IT professionals I know are waiting for a major hardware vendor to help them with a performance issue in a 40,000 server. Theyve been discussing it with the vendor for weeks theyve spent time and effort running extensive tests and benchmarks at the vendors request and so far the vendors reaction has been a mixture of incompetence, fecklessness and apathy. The 40,000 server is sitting there performing very, very slowly, and its users are working 70-hour weeks to try to stay on schedule. Over the years I have seen many, many problems with expensive commercial software ndash everything from bugs to performance issues to incompatibility to insufficient documentation. Sometimes these problems cause a late night or a lost weekend for the user sometimes they cause missed deadlines and angry clients sometimes it goes as far as legal and reputational risk. Every single time, the same thing happens: the problem is fixed by the end users, using a combination of blood, sweat, tears, Google and late nights. I have never seen the vendor swoop to the rescue and make everything OK. So what is the support for PostgreSQL like On the two occasions I have asked the PostgreSQL mailing list for help, I have received replies from Tom Lane within 24 hours. Take a moment to click on the link and read the wiki - the guy is not just a lead developer of PostgreSQL, hes a well-known computer programmer. Needless to say, his advice is as good as advice gets. On one of the occasions, where I asked a question about the best way to implement cross-function call persistent memory allocation, Lane replied with the features of PostgreSQL I should study and suggested solutions to my problem ndash and for good measure he threw in a list of very good reasons why my tentative solution (a C static variable) was rubbish. You cant buy that kind of support, but you can get it from a community of enthusiastic open source developers. Oh, did I mention that the total cost of the database software and the helpful advice and recommendations from the acclaimed programmer was 0.00 Note that by support I mean help getting it to work properly. Some people (usually people who dont actually use the product) think of support contracts more in terms of legal coverage ndash theyre not really interested in whether help is forthcoming or not, but they like that theres someone to shout at and, more importantly, blame. I discuss this too, here . (And if youre really determined to pay someone to help you out, you can of course go to any of the organisations which provide professional support for PostgreSQL. Unlike commercial software vendors, whose support functions are secondary to their main business of selling products, these organisations live or die by the quality of the support they provide, so it is very good.) 1.14. Flexible, scriptable database dumps Ive already talked about scriptability, but database dumps are very important, so they get their own bit here. PostgreSQLs dump utility is extremely flexible, command-line driven (making it easily automatable and scriptable) and well-documented (like the rest of PostgreSQL). This makes database migration, replication and backups ndash three important and scary tasks ndash controllable, reliable and configurable. Moreover, backups can be in a space-effecient compressed format or in plain SQL, complete with data, making them both human-readable and executable. A backup can be of a single table or of a whole database cluster. The user gets to do exactly as he pleases. With a little work and careful selection of options, it is even possible to make a DDL-only plain SQL PostgreSQL backup executable in a different RDBMS. MS SQL Servers backups are in a proprietary, undocumented, opaque binary format. 1.15. Reliability Neither PostgreSQL nor MS SQL Server are crash-happy, but MS SQL Server does have a bizarre failure mode which I have witnessed more than once: its transaction logs become enormous and prevent the database from working. In theory the logs can be truncated or deleted but the documentation is full of dire warnings against such action. PostgreSQL simply sits there working and getting things done. I have never seen a PostgreSQL database crash in normal use. PostgreSQL is relatively bug-free compared to MS SQL Server. I once found a bug in PostgreSQL 8.4 ndash it was performing a string distance calculation algorithm wrongly. This was a problem for me because I needed to use the algorithm in some fuzzy deduplication code I was writing for work. I looked up the algorithm on Wikipedia, gained a rough idea of how it works, found the implementation in the PostgreSQL source code, wrote a fix and emailed it to one of the PostgreSQL developers. In the next release of PostgreSQL, version 9.0, the bug was fixed. Meanwhile, I applied my fix to my own installation of PostgreSQL 8.4, re-compiled it and kept working. This will be a familiar story to many of the users of PostgreSQL, and indeed any large piece of open source software. The community benefits from high-quality free software, and individuals with the appropriate skills do what they can to contribute. Everyone wins. With a closed-source product, you cant fix it yourself ndash you just raise a bug report, cross your fingers and wait. If MS SQL Server were open source, section 1.1 above would not exist, because I (and probably thousands of other frustrated users) would have damn well written a proper CSV parser and plumbed it in years ago. 1.16. Ease of installing and updating Does this matter Well, yes. Infrastructure flexibility is more important than ever and that trend will only continue. Gone are the days of the big fat server install which sits untouched for years on end. These days its all about fast, reliable, flexible provisioning and keeping up with cutting-edge features. Also, as the saying goes, time is money. I have installed MS SQL Server several times. I have installed PostgreSQL more times than I can remember - probably at least 50 times. Installing MS SQL Server is very slow. It involves immense downloads (who still uses physical install media) and lengthy, important-sounding processes with stately progress bars. It might fail if you dont have the right version of or the right Windows service pack installed. Its the kind of thing your sysadmin needs to find a solid block of time for. Installing PostgreSQL the canonical way ndash from a Linux repo ndash is as easy as typing a single command, like this: How long does it take I just tested this by spinning up a cheap VM in the cloud and installing PostgreSQL using the above command. It took 16 seconds . Thats the total time for the download and the install. As for updates, any software backed by a Linux repo is trivially easily patched and updated by pulling updates from the repo. Because repos are clever and PostgreSQL is not obscenely bloated, downloads are small and fast and application of updates is efficient. I dont know how easy MS SQL Server is to update. I do know that a lot of production MS SQL Server boxes in certain organisations are still on version 2008 R2 though. 1.17. The contrib modules As if the enormous feature set of PostgreSQL is not enough, it comes with a set of extensions called contrib modules. There are libraries of functions, types and utilities for doing certain useful things which dont quite fall into the core feature set of the server. There are libraries for fuzzy string matching, fast integer array handling, external database connectivity, cryptography, UUID generation, tree data types and loads, loads more. A few of the modules dont even do anything except provide templates to allow developers and advanced users to develop their own extensions and custom functionality. Of course, these extensions are trivially easy to install. For example, to install the fuzzystrmatch extension you do this: 1.18. Its free PostgreSQL is free as in freedom and free as in beer. Both types of free are extremely important. The first kind, free as in freedom, means PostgreSQL is open-source and very permissively licensed. In practical terms, this means that you can do whatever you want with it, including distributing software which includes it or is based on it. You can modify it in whatever way you see fit, and then you can distribute the modifications to whomever you like. You can install it as many times as you like, on whatever you like, and then use it for any purpose you like. The second kind, free as in beer, is important for two main reasons. The first is that if, like me, you work for a large organisation, spending that organisations money involves red tape. Red tape means delays and delays sap everyones energy and enthusiasm and suppress innovation. The second reason is that because PostgreSQL is free, many developers, experimenters, hackers, students, innovators, scientists and so on (the brainy-but-poor crowd, essentially) use it, and it develops a wonderful community. This results in great support (as I mentioned above ) and contributions from the intellectual elite. It results in a better product, more innovation, more solutions to problems and more time and energy spent on the things that really matter. 2. The counterarguments For reasons which have always eluded me, people often like to ignore all the arguments and evidence above and try to dismiss the case for PostgreSQL using misconceptions, myths, red herrings and outright nonsense. Stuff like this: 2.1. But a big-name vendor provides a safety net No it doesnt. This misconception is a variant of the old adage no-one ever got fired for buying IBM. Hilariously, if you type that into Google, the first hit is the Wikipedia article on fear, uncertainty and doubt - and even more hilariously, the first entry in the examples section is Microsoft. I promise I did not touch the Wikipedia article, I simply found it like that. In client-serving data analytics, you just have to get it right. If you destroy your reputation by buggering up an important job, your software vendor will not build you a new reputation. If you get sued, then maybe you can recover costs from your vendor - but only if they did something wrong. Microsoft isnt doing anything technically wrong with MS SQL Server, theyre simply releasing a terrible product and being up front about how terrible it is. The documentation admits its terrible. It works exactly as designed the problem is that the design is terrible. You cant sue Microsoft just because you didnt do your due diligence when you picked a database. Even if you somehow do successfully blame the vendor, you still have a messed up job and an angry client, who wont want to hear about MS SQL Servers unfortunate treatment of UTF-16 text as UCS-2, resulting in truncation of a surrogate pair during a substring operation and subsequent failure to identify an incriminating keyword. At best they will continue to demand results (and probably a discount) at worst, they will write you off as incompetent ndash and who could blame them, when you trusted their job to a RDBMS whose docs unapologetically acknowledge that it might silently corrupt your data Since the best way to minimise risk is to get the job done right, the best tool to use is the one which is most likely to let you accomplish that. In this case, thats PostgreSQL. 2.2. But what happens if the author of PostgreSQL dies Same thing that happens if the author of MS SQL Server dies ndash nothing. Also, needless to say, the author of PostgreSQL is as meaningless as the author of MS SQL Server. Theres no such thing. A senior individual with an IT infrastructure oversight role actually asked me this question once (about Hadoop, not PostgreSQL). There just seems to be a misconception that all open-source software is written by a loner who lives in his mums basement. This is obviously not true. Large open source projects like PostgreSQL and Hadoop are written by teams of highly skilled developers who are often commercially sponsored. At its heart, the development model of PostgreSQL is just like the development model of MS SQL Server: a large team of programmers is paid by an organisation to write code. There is no single point of failure. There is at least one key difference, though: PostgreSQLs source code is openly available and is therefore reviewed, tweaked, contributed to, improved and understood by a huge community of skilled programmers. Thats one of the reasons why its so much better. Crucially, because open-source software tends to be written by people who care deeply about its quality (often because they have a direct personal stake in ensuring that the software works as well as possible), it is often of the very highest standard (PostgreSQL, Linux, MySQL, XBMC, Hadoop, Android, VLC, Neo4JS, Redis, 7Zip, FreeBSD, golang, PHP, Python, R, Nginx, Apache, node.js, Chrome, Firefox. ). On the other hand, commercial software is often designed by committee, written in cube farms and developed without proper guidance or inspiration (Microsoft BOB, RealPlayer, Internet Explorer 6, iOS Maps, Lotus Notes, Windows ME, Windows Vista, QuickTime, SharePoint. ) 2.3. But open-source software isnt securereliabletrustworthyenterprise-readyetc Theres no kind way to say this: anyone who says such a thing is very ignorant, and you should ignore them ndash or, if youre feeling generous, educate them. Well, I guess Im feeling generous: Security: the idea that closed-source is more secure is an old misconception, for many good reasons which I will briefly summarise (but do read the links ndash theyre excellent): secrecy isnt the same as security an open review process is more likely to find weaknesses than a closed one properly reviewed open source software is difficult or impossible to build a back door into. If you prefer anecdotal evidence to logical arguments, consider that Microsoft Internet Explorer 6, once a flagship closed-source commercial product, is widely regarded as the least secure software ever produced, and that Rijndael, the algorithm behind AES, which governments the world over use to protect top secret information, is an open standard. In any case, relational databases are not security software. In the IT world, security is a bit like support our troops in the USA or think of the children in the UK ndash a trump card which overrules all other considerations, including common sense and evidence. Dont fall for it. Reliability: Windows was at one point renowned for its instability, although these days things are much better. (Supposedly, Windows 9x would spontaneously crash when its internal uptime counter, counting in milliseconds, exceeded the upper bound of an unsigned 32-bit integer, i.e. after 2 32 milliseconds or about 49.7 days. I have always wanted to try this.) Linux dominates the server space, where reliability is key, and Linux boxes routinely achieve uptimes measured in years. Internet Explorer has always (and still does) failed to comply with web standards, causing websites to break or function improperly the leaders in the field are the open-source browsers Chrome and Firefox. Lotus Notes is a flaky, crash-happy, evil mess Thunderbird just works. And I have more than once seen MS SQL Server paralyse itself by letting transaction log files blow up, something PostgreSQL does not do. Trustworthiness: unless youve been living under a rock for the past couple of years, you know who Edward Snowden is. Thanks to him, we know exactly what you cannot trust: governments and the large organisations they get their hooks into. Since Snowden went public, it is clear that NSA back doors exist in a vast array of products, both hardware and software, that individuals and organisations depend on to keep their data secure. The only defence against this is open code review. The only software that can be subjected to open code review is open source software. If you use proprietary closed-source software, you have no way of knowing what it is really doing under the hood. And thanks to Mr. Snowden, we now know that there is an excellent chance it is giving your secrets away. At the time of writing, 485 of the top 500 supercomputers in the world run on Linux. As of July 2014, Nginx and Apache, two open-source web servers, power over 70 of the million busiest sites on the net. The computers on the International Space Station (the most expensive single man-made object in existence) were moved from Windows to Linux in 2013 in an attempt to improve stability and reliability. The back-end database of Skype (ironically now owned by Microsoft) is PostgreSQL. GCHQ recently reported that Ubuntu Linux is the most secure commonly-available desktop operating system. The Large Hadron Collider is the worlds largest scientific experiment. Its supporting IT infrastructure, the Worldwide LHC Computing Grid, is the worlds largest computing grid. It handles 30 PB of data per year and spans 36 countries and over 170 computing centres. It runs primarily on Linux. Hadoop, the current darling of many large consultancies looking to earn Big Data credentials, is open-source. Red Hat Enterprise Linux CEntOS (Community Enterprise OS) SUSE Linux Enterprise Server Oracle Linux IBM Enterprise Linux Server etc. The idea that open-source software is not for the enterprise is pure bullshit. If you work in tech for an organisation which disregards open source, enjoy it while it lasts. They wont be around for long. 2.4. But MS SQL Server can use multiple CPU cores for a single query This is an advantage for MS SQL Server whenever youre running a query which is CPU-bound and not IO-bound. In real-life data analytics this happens approximately once every three blue moons. On those very rare, very specific occasions when CPU power is truly the bottleneck, you almost certainly should be using something other than an RDBMS. RDBMSes are not for number crunching. This advantage goes away when a server has to do many things at once (as is almost always the case). PostgreSQL uses multiprocessing ndash different connections run in different processes, and hence on different CPU cores. The scheduler of the OS takes care of this. Also, I suspect this query parallelism is what necessitates the merge method which MS SQL Server custom aggregate assemblies are required to implement bits of aggregation done in different threads have to be combined with each other, MapReduce-style. I further suspect that this mechanism is what prevents MS SQL Server aggregates from accepting ORDER BY clauses. So, congratulations ndash you can use more than one CPU core, but you cant do a basic string roll-up. 2.5. But I have MS SQL Server skills, not PostgreSQL skills Youd rather stick with a clumsy, awkward, unreliable system than spend the trivial amount of effort it takes to learn a slightly different dialect of a straightforward querying language Well, just hope you never end up in a job interview with me. 2.6. But a billion Microsoft users cant all be wrong This is a real-life quotation as well, from a senior data analyst I used to work with. I replied well there are 1.5 billion Muslims and 1.2 billion Catholics. They cant all be right. Ergo, a billion people most certainly can be wrong. (In this particular case, 2.7 billion people are wrong.) 2.7. But if it were really that good then it wouldnt be free People actually say this too. I feel sorry for these people, because they are unable to conceive of anyone doing anything for any reason other than monetary gain. Presumably they are also unaware of the existence of charities or volunteers or unpaid bloggers or any of the other things people do purely out of a desire to contribute or to create something or simply to take on a challenge. This argument also depends on an assumption that open source development has no benefit for the developer, which is nonsense. The reason large enterprises open-source their code and then pay their teams to continue working on it is because doing so benefits them. If you open up your code and others use it, then you have just gained a completely free source of bug fixes, feature contributions, code review, product testing and publicity. If your product is good enough, it is used by enough people that it starts having an influence on standards, which means broader industry acceptance. You then have a favoured position in the market as a provider of support and deployment services for the software. Open-sourcing your code is often the most sensible course of action even if you are completely self-interested. As a case in point, here I am spending my free time writing a web page about how fabulous PostgreSQL is and then paying my own money to host it. Perhaps Teradata or Oracle are just as amazing, but theyre not getting their own pages because I cant afford them, so I dont use them. 2.8. But youre biased No, I have a preference. The whole point of this document is to demonstrate, using evidence, that this preference is justified. If you read this and assume that just because I massively prefer PostgreSQL I must be biased, that means you are biased, because you have refused to seriously consider the possibility that it really is better. If you think theres actual evidence that I really am biased, let me know. 2.9. But PostgreSQL is a stupid name This one is arguably true its pretty awkward. It is commonly mispronounced, very commonly misspelt and almost always incorrectly capitalised. Its a good job that stupidness of name is not something serious human beings take into account when theyre choosing industrial software products. That being said, MS SQL Server is literally the most boring possible name for a SQL Server provided by MS. It has anywhere from six to eight syllables, depending on whether or not you abbreviate Microsoft and whether you say it sequel or ess queue ell, which is far too many syllables for a product name. Microsoft has a thing for very long names though ndash possibly its greatest achievement ever is Microsoft WinFX Software Development Kit for Microsoft Pre-Release Windows Operating System Code-Named Longhorn, Beta 1 Web Setup I count 38 syllables. Wow. 2.10. But SSMS is better than PGAdmin Its slicker, sure. Its prettier. It has code completion, although I always turn that off because it constantly screws things up, and for every time it helps me out with a field or table name, theres at least one occasion when it does something mental, like auto-correcting a common SQL keyword like table to a Microsoft monstrosity like TABULATIONNONTRIVIALDISCOMBOBULATEDMACHIAVELLIANGANGLYONID or something. For actually executing SQL and looking at the results in a GUI, PGAdmin is fine. Its just not spectacular. SSMS is obviously Windows-only. PGAdmin is cross-platform. This is actually quite convenient. You can run PGAdmin in Windows, where you have all your familiar stuff ndash Office, Outlook etc. ndash whilst keeping the back end RDBMS in Linux. This gets you the best of both worlds (even an open source advocate like me admits that if youre a heavy MS Office user, there is no serious alternative). Several guys I work with do this. One point in SSMSs favour is that if you run several row-returning statements in a batch, it will give you all the results. PGAdmin returns only the last result set. This can be a drag when doing data analytics, where you often want to simultaneously query several data sets and compare the results. Theres another thing though: psql. This is PostgreSQLs command-line SQL interface. Its really, really good. It has loads of useful catalog-querying features. It displays tabular data intelligently. It has tab completion which, unlike SSMSs code completion, is actually useful, because it is context sensitive. So, for example, if you type DROP SCHEMA t and hit tab, it will suggest schema names starting with t (or, if there is only one, auto-fill it for you). It lets you jump around in the file system and use ultra-powerful text editors like vim inline. It automatically keeps a list of executed commands. It provides convenient, useful data import and export functionality, including the COPY TO PROGRAM feature which makes smashing use of pipes and command-line utilities to provide another level of flexibility and control of data. It makes intelligent use of screen space. It is fast and convenient. You can use it over an SSH connection, even a slow one. Its only serious disadvantage is that it is unsuitable for people who want to be data analysts, but are scared of command lines and typing on a keyboard. 2.11. But MS SQL Server can import straight from Excel Yes. So what Excel can output to CSV (in a rare moment of sanity, Microsoft made Excels CSV export code work properly) and PostgreSQL can import CSV. Admittedly, its an extra step. Is the ability to import straight from Excel a particularly important feature in an analytics platform anyway 2.12. But PostgreSQL is slower than MS SQL Server A more accurate rephrasing would be MS SQL Server is slightly more forgiving if you dont know what youre doing. For certain operations, PostgreSQL is definitely slower than MS SQL Server ndash the easiest example is probably COUNT(). which is (I think) always instant in MS SQL Server and in PostgreSQL requires a full table scan (this is due to the different concurrency models they use). PostgreSQL is slow out-of-the box because its default configuration uses only a tiny amount of system resources ndash but any system being used for serious work has been tuned properly, so raw out-of-the-box performance is not a worthwhile thing to argue about. I once saw PostgreSQL criticised as slow because it was taking a long time to do some big, complex regex operations on a large table. But everyone knows that regex operations can be very computationally expensive, and in any case, what was PostgreSQL being compared to Certainly not the MS SQL Server boxes, which couldnt do regexes. PostgreSQLs extensive support for very clever indexes, such as range type indexes and trigram indexes, makes it orders of magnitude faster than MS SQL Server for a certain class of operations. But only if you know how to use those features properly. The immense flexibility you get from the great procedural language support and the clever data types allows PostgreSQL-based solutions to outperform MS SQL Server-based solutions by orders of magnitude. See my earlier example . In any case, the argument about speed is never only about computer time it is about developer time too. Thats why high-level languages like PHP and Python are very popular, despite the fact that C kicks the shit out of them when it comes to execution speed. They are slower to run but much faster to use for development. Would you prefer to spend an hour writing maintainable, elegant SQL followed by an hour of runtime, or spend three days writing buggy, desperate workarounds followed by 45 minutes of runtime 2.13. But you never mentioned such-and-such feature of MS SQL Server As I said in the banner and the intro. I am comparing these databases from the point of view of a data analyst, because Im a data analyst and I use them for data analysis. I know about SSRS, SSAS, in-memory column stores and so on, but I havent mentioned them because I dont use them (or equivalent features). Yes, this means this is not a comprehensive comparison of the two databases, and I never said it would be. It also means that if you care mostly about OLTP or data warehousing, you might not find this document very helpful. 2.14. But Microsoft has open-sourced Yeah, mere hours after I wrote all about how theyre a vendor lock-in monster and are anti-open source. Doh. However, lets look at this in context. Remember the almighty ruckus when the Office Open XML standard was being created Microsoft played every dirty trick in the book to ensure that MS Office wouldnt lose its dominance. Successfully, too ndash the closest alternative, LibreOffice, is still not a viable option, largely because of incompatibility with document formats. The OOXML standard that was finally pushed through is immense, bloated, ambiguous, inconsistent and riddled with errors. That debacle also started with an apparent gesture toward open standards on Microsofts part. If that seems harsh or paranoid, lets remember that this is an organisation that has been in legal trouble with both the USA and the EU for monopolistic and anticompetitive behaviour and abuse of market power, in the latter case being fined almost half a billion Euros. Then theres the involvement in SCOs potentially Linux-killing lawsuit against IBM. When Steve Ballmer was CEO he described Linux as a cancer (although Ballmer also said Theres no chance that the iPhone is going to get any significant market share. No chance, so maybe he just likes to talk nonsense). Microsoft has a long-established policy of preferring conquest to cooperation. So, if they play nice for the next few years and their magnanimous gesture ushers in a new era of interoperability, productivity and harmony, I (and millions of developers who want to get on with creating great things instead of bickering over platforms and standards) will be over the moon. For now, thinking that MS has suddenly become all warm and fuzzy would just be naive. 2.15. But youre insultingI dont like your toneyou come across as angryyou sound like a fanboythis is unprofessionalthis is a rant This page is unprofessional by definition ndash Im not being paid to write it. That also means I get to use whatever tone I like, and I dont have to hide the way I feel about things. I hope you appreciate the technical content even if you dont like the way I write if my tone makes this document unreadable for you, then I guess Ive lost a reader and youve lost a web page. Cest la vie.
Bagaimana-banyak-saham-pilihan-untuk-apel-karyawan
Texas-trading-systems