The purpose of this project is to study postgresql with Rails.
For now the docker-compose.yml only have PostgreSQL and pgAdmin. You can start this dependencies with:
docker-compose up
URL: http://localhost:80/
email: admin@root.com
password: SuperSecret
Host name/address: postgresdb
username: index_demo
password: index_demo
Go to the console with rails c
and populate the database using factory bot: FactoryBot.create_list(:user, 500000)
. The number of users is up to you.
For now we can run rails db:rollback
, with the objective to remove the indexs, and rails db:migrate
to add the indexs. Run the SQLs between this commands and see for yourself the results.
SELECT *
FROM users
WHERE lower(first_name) LIKE 'theodore%';
SELECT *
FROM users
WHERE regexp_replace(phone, '[^0-9]+', '') LIKE '5639%';