Ruby on Rails Database Indexes
Contact me at LinkedIn  RailsZilla at Facebook  RailsZilla at twitter   google +1  Contact me at Xing  connect me at github

Ruby on Rails Database Indexes

Posted in Rails

Handy hint for better database performance in Ruby on Rails: Always add DB index in your Migration! By default, rails does not add indexes automatically for foreign key, you should add indexes by yourself. If you want to speed up your performance, I suggest to add an index for – foreign key – columns that […]

Tags: , , , , , ,

Postgresql and TCP/IP connections on port 5432

Posted in coffee break, console

When working with Postgresql, I got the error 1234PG::Error could not connect to server: Connection refused     Is the server running on host "localhost" (127.0.0.1) and accepting     TCP/IP connections on port 5432? This can happen, if you didn’t configure your server specifically. To see if your Postgresql is accepting requests, simply run […]

Tags: , , , , , , ,

Rails seed data example

Posted in Rails

The most ugly code smells in Rails applications is the use of migrations as a way to carry seed data. This is data that needs to be added to the database on deployment. I really hate it, because it’s hard to maintain and doesn’t play well with loading up the database from the schema file. […]

Tags: , , , , , , ,

mongoDB connection problem

Posted in coffee break, Rails, Ruby

if mongo won’t run, try 1234sudo rm /var/lib/mongodb/mongod.lock sudo -u mongodb mongod -f /etc/mongodb.conf –repair sudo start mongodb sudo status mongodb should fix your problems ;-)

Tags: , , , ,

Copyright © 2011-2017  - RailsZilla – Ruby on Rails tutorials, tips and tricks All rights reserved. | Imprint | Privacy