Postgres 9.1 vs Mysql 5.6 InnoDB?
Postgres 9.1 vs Mysql 5.6 InnoDB?
Simple question - what would better for a medium/big size database with requirement for compatibility with ACID in 2012.
I have read it all (well most) about mySQL vs pgSQL but most of those posts relate to version 4,5.1 and 7,8 respectively and are quite dated (2008,2009). Its almost 2012 now so I guess we could try and take a fresh look at the issue.
Basically I would like to know if there is anything in PostgreSQL that out-weights ease of use, availability and larger developer/knowledge base of MySQL.
Is MySQL's query optimizer still stupid? Is it still super slow on very complicated queries?
Hit me! :)
PS. And don't send me to goggle or wiki. I am looking for few specific points not an overview + I trust StackOverflow more than some random page with 'smart guy' shining his light.
Addendum
Size of the project: Say an ordering system with roughly 10-100 orders/day per account, couple of thousand accounts, eventually, each can have several hundred to several thousand users.
Better at: being future proof and flexible when it comes to growing and changing requirements. Performance is also important as to keep costs low in hardware department. Also availability of skilled workforce would be a factor.
OLTP or OLAP: OLTP
Answer by a_horse_with_no_name for Postgres 9.1 vs Mysql 5.6 InnoDB?
PostgreSQL is a lot more advanced when it comes to SQL features.
Things that MySQL still doesn't have (and PostgreSQL has):
- deferrable constraints
- check constraints
- full outer join
MySQL silently uses an inner join with some syntax variations: http://sqlfiddle.com/#!2/88ff95/1
The SQLFiddle was created using MySQL 5.5.32 - regular expressions don't work with UTF-8
- regular expressions don't support replace or substring)
- table functions (
select * from my_function()) - common table expressions
- recursive queries (using common table expressions)
- windowing functions
- function based index
- partial index
full text search on transactional tables(MySQL 5.6 supports this now as well)- GIS features on transactional tables
- MINUS or INTERSECT operator
- you cannot use a temporary table twice in the same select statement
- you cannot use the table being changed (update/delete/insert) in a sub-select
you cannot create a view that uses a derived table
create view x as select * from (select * from y);- transactional DDL
- exclusion constraints
- key/value store
- JSON support (MySQL 5.7 has JSON support but JSON documents cannot be indexed)
- range types
- arrays (including indexes on arrays)
- roles (groups) to manage user privileges
Not sure what you call "ease of use" but there are several modern SQL features that I would not want to miss (CTEs, windowing functions) that would define "ease of use" for me.
Now PostgreSQL is not perfect and probably the most obnoxious thing can be, to tune the dreaded VACUUM process for a heavy write database.
Answer by Richard Huxton for Postgres 9.1 vs Mysql 5.6 InnoDB?
Is MySQL's query optimizer still stupid? Is it still super slow on very complicated queries?
All query optimizers are stupid at times. PostgreSQL's is less stupid in most cases. Some of PostgreSQL's more recent SQL features (windowing functions, recursive WITH queries etc) are very powerful but if you have a dumb ORM they might not be usable.
Size of the project: Say an ordering system with roughly 10-100 orders/day per account, couple of thousand accounts, eventually, each can have several hundred to several thousand users.
Doesn't sound that large - well within reach of a big box.
Better at: being future proof and flexible when it comes to growing and changing requirements.
PostgreSQL has a strong developer team, with an extended community of contributors. Release policy is strict, with bugfixes-only in the point releases. Always track the latest release of 9.1.x for the bugfixes.
MySQL has had a somewhat more relaxed attitude to version numbers in the past. That may change with Oracle being in charge. I'm not familiar with the policies of the various forks.
Performance is also important as to keep costs low in hardware department.
I'd be surprised if hardware turned out to be a major component in a project this size.
Also availability of skilled workforce would be a factor.
That's your key decider. If you've got a team of experienced Perl + PostgreSQL hackers sat around idle, use that. If your people know Lisp and MySQL then use that.
OLTP or OLAP: OLTP
PostgreSQL has always been strong on OLTP.
My personal viewpoint is that the PostgreSQL mailing list are full of polite, helpful, knowledgeable people. You have direct contact with users with Terabyte databases and hackers who have built major parts of the code. The quality of the support is truly excellent.
Answer by Devin Bayer for Postgres 9.1 vs Mysql 5.6 InnoDB?
Here are some benchmarks using these exact versions:
http://posulliv.github.io/2012/06/29/mysql-postgres-bench/
My take was that MySQL was about 30% faster for simple tasks and 500% slower for more complex queries, likely due to the query optimiser.
Answer by Sergey Grigoriev for Postgres 9.1 vs Mysql 5.6 InnoDB?
PostgreSQL is a more mature database, it has a longer history, it is more ANSI SQL compliant, its query optimizer is significantly better. MySQL has different storage engines like MyISAM, InnoDB, in-memory, all of them are incompatible in a sense that an SQL query which runs on one engine may produce a syntax error when executed on another engine. Stored procedures are better in PostgreSQL.
Answer by Roman Pekar for Postgres 9.1 vs Mysql 5.6 InnoDB?
As an addition to @a_horse_with_no_name answer, I want to name some features which I like so much in PostgreSQL:
- arrays data type;
- hstore extension - very useful for storing
key->valuedata, possible to create index on columns of that type; - various language extensions - I find Python very useful when it comes to unstructured data handling;
distinct onsyntax - I think this one should be ANSI SQL feature, it looks very natural to me (as opposed to MySQL group by syntax);- composite types;
- record types;
- inheritance;
- Version 9.3 features:
- lateral joins - one thing I miss from SQL Server (where it called outer/cross apply);
- native JSON support;
- DDL triggers;
- recursive, materialized, updatable views;
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment