tags:

views:

275

answers:

4

I recently switched a project from MySQL InnoDB to PostgreSQL, and I feel bigger lags when inserting and updating data with ajax. This may be subjective. I know the Django devs recommend postgres and I know psycopg2 is supposed to be faster than MysqlDB. Personaly I like the way postgres enforces database integrity, but am mostly worried about performance for this project. Want to hear other people's opinion on this.

A: 

SQLite. No backend server. Excellent for dev

joshhunt
+2  A: 

Why don't you measure? That's the only way to be sure about the performance. Hand waving about how slow or not is something without hard data is like trying to catch water with your hands.

Measure transactions per second or even better, requests per second with a web server stress tool like The Grinder (which can be scripted in Jython) with both MySQL backend and PostgreSQL and afterwards see if that makes a difference. If it does, ask around here, or, more specifically, ask on the pgsql-general or pgsql-performance mailing lists. There are many expert people there which know loads about it, even the main devs. There are tons of knobs on PostgreSQL configuration related to performance.

Vinko Vrsalovic
+2  A: 

It may be incorrect usage of indexes. Simply making sure you have the right indexes, and making sure the tables are analyzed and vacuumed periodically should give rather decent results.

Even if Postgres turns out to be a minuscule slower, in some cases, my personal opinion is that the features it provides greatly outweigh the minor performance losses.

Postgres really is a beautiful database, and any time I'm using anything else, I wish I was using Postgres.

Kent Fredric
True. I was kinda assuming the basics would have been take care of :-) And indeed Postgres is lovable.
Vinko Vrsalovic
+1  A: 

I used SQLite for the first time in the development phase of the last project. It is easy to set up, convenient to carry around from one dev system to another, etc. I have to add that when I finally moved the project to production over on MySQL, a number of subtle issues manifested themselves with MySQL that were not present at all with SQLite. Nothing big, but from now on if I have to deploy a project on MySQL, I would prefer to use MySQL in the development phase too.

ayaz