i have a products table and select data with two queries below and time are executed, it is shown in debugbar (two queries is only changed field to select, structure to query is the same each other):
select * from `products` order by `created_at` desc limit 11 670μs shop
select * from `images` where `images`.`product_id` in ('3', '2', '1') 650μs shop
and another.
select `id`, `name`, `price`, `code` from `products` order by `created_at` desc limit 11 1.19ms shop
select * from `images` where `images`.`product_id` in ('3', '2', '1') 800μs shop
i have reloaded more times and time to load "select * " is always lessthan "Select id
, name
, price
, code
". So, does query with select all field is always faster than select specific columns and why? Thanks!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire