Skip to content
This repository was archived by the owner on May 19, 2020. It is now read-only.

This repository is used to benchmark how Laravel Eloquent handles a database view for a model compared to a normal table.

Notifications You must be signed in to change notification settings

hmazter/database-view-benchmark

Repository files navigation

Benchmark Database views for Laravel Eloquent

This repository is used to benchmark how Laravel Eloquent handles a database view for a model compared to a normal table.

Read the blog post here: https://www.hmazter.com/2018/09/using-database-views-as-tables-for-laravel-eloquent/

Installation

  1. git clone
  2. composer install
  3. copy .env.example and edit .env
  4. php artisan migrate --seed

Usage

Run one of these artisan commands using the unix time command:

fetch-posts-from-table-model  Fetch posts from the table model
fetch-posts-from-table-query  Fetch posts from the table with a query
fetch-posts-from-view-model   Fetch posts from the view model
fetch-posts-from-view-query   Fetch posts from the view with a query

ex:

time php artisan fetch-posts-from-table-model

About

This repository is used to benchmark how Laravel Eloquent handles a database view for a model compared to a normal table.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published