Avatar of RGuillermo
RGuillermoFlag for United States of America

asked on 

Mysql select .. how to chose index

Hello Experts,
I have a table with 140 thousand records
and a simple select like:

SELECT * FROM TBL_TRE_CO2 WHERE PAT_COD =12728

field pat_cod is the second index (not automatic increment which is the first index)

takes 5 seconds which is too much for each query
then I executed EXPLAIN  showing there is "no possible keys", and "  No keys"

how can I force the select to use a certain index?

Best regards,


MySQL Server

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
MySQL Server
MySQL Server

MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.

49K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo