0
votes

I have database catalogs with 14000 records, 100 columns and just 2 columns with type longtext. This query was really slow - more than 40 seconds

SELECT
    id,
    title,
    pdf
FROM
    catalogs
WHERE
    (shop_id = 2597)

for experiement I create new database called new_catalogs with the same structure and data but I remove 2 columns with longtext type

Running the same query was double faster - 20 seconds.

Why longtext field slow up query? How to speed up my current database which must contain these 2 columns with longtext ? I didnt select these 2 columns to get.

Using laravel queries I got the same results.

missing index?Dmitri T
What does the execution plan tell you about this?Nico Haase
Is PHP related? Seems like just a mysql performance issue.user3783243
Yes @DmitriT INDEX was missing. So powerful to put INDEX on shop_id !!! You save my life. Thanbks a lot!Aleks Per