MI-DPLA / combine

Combine /kämˌbīn/ - Metadata Aggregator Platform
MIT License
26 stars 11 forks source link

Record details page not working with large DB #253

Closed ghukill closed 5 years ago

ghukill commented 5 years ago

After pushing past the 6-7 million mark, unable to load single Record page. Checking MySQL queries for the page, seeing the following query that appears to gum up the works:

62 | combine | localhost:50366 | combine | Query   |    2 | Sending data | SELECT COUNT(*) AS `__count` FROM `core_record` WHERE (`core_record`.`job_id` = 226 AND `core_record`.`combine_id` = 'b7a87cc0-6499-455d-b5fd-3367852163b5') 

Believe this is looking for other records in the lineage. Might need to add combine_id to indexed columns, or see if this query can be improved by including a WHERE the id equals the Record id.

ghukill commented 5 years ago

Added record_id and combine_id to Record table indices, bottleneck gone.