Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
La vista MySql es muy lenta. ¿Por qué?

Mi consulta normal:

 SELECT DISTINCT vt.id as id, vtt.name as n, vt.etxid as etx FROM vt LEFT JOIN vtt ON (vtt.locale = "etx" AND vtt.etxid = vt.etxid)

Tiempo de ejecución: 5ms

Mi vista:

 CREATE OR REPLACE VIEW myview AS SELECT DISTINCT vt.id as id, vtt.name as n, vt.etxid as etx FROM vt LEFT JOIN vtt ON (vtt.locale = "etx" AND vtt.etxid = vt.etxid)

Mi consulta de vista:

 SELECT * from myview;

Tiempo de ejecución: 600ms

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Tan pronto como mencione las funciones DISTINCT o de agregación en una vista, MySQL selecciona el algoritmo TEMPTABLE para esta vista, lo que significa que creará una tabla temporal para la vista y luego le aplicará clasificación, agrupación y agregaciones. Ver más detalles aquí . Además, aquí hay algunas recomendaciones sobre el rendimiento de visualización .

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!