[Vtigercrm-developers] Report records count error

Joe Bordes joe at tsolucio.com
Mon Feb 22 23:14:09 GMT 2021


Hi Henry

Can you try a UNION?

SELECT count(*) AS count
FROM

(select vtiger_contactdetails.contactid,vtiger_potential.potentialid

FROM...

LEFT JOIN vtiger_reptmptbl_16022b18c38f2c3425974780 AS 
vtiger_contactdetails ON vtiger_potential.contact_id = 
vtiger_contactdetails.contactid

...

UNION

select vtiger_contactdetails.contactid,vtiger_potential.potentialid

FROM...

LEFT JOIN vtiger_reptmptbl_16022b18c38f2c3425974780 AS 
vtiger_contactdetails ON vtiger_contactdetails.contactid = 
vtiger_contpotentialrel.contactid

...

) as counttable


Joe

TSolucio


On 12/2/21 18:06, Henry Cumbicus Rivera wrote:
> Hello Alan,
> this is the result when I do the explain to the query
>
>
> Explain query: https://prnt.sc/z8mn7y
>
> image.png
>
>
>
> El vie, 12 feb 2021 a las 3:33, Alan Lord (<alanslists at gmail.com 
> <mailto:alanslists at gmail.com>>) escribió:
>
>     On 11/02/2021 22:54, Rubén A. Estrada Orozco wrote:
>     > Maybe using the "EXPLAIN" mysql function to see what indexes are
>     being
>     > used, then trying to modify the query accordingly and/or add
>     indexes to
>     > your database.
>
>     This is correct IMHO. Use EXPLAIN to see why the query is taking so
>     long. Also you could try enabling the slow query log in mysql.
>
>     You are probably missing an index somewhere.
>
>     HTH
>
>     Al
>     _______________________________________________
>     http://www.vtiger.com/
>
>
>
> -- 
>
> ---------------------------------------------------------------
> Henry C.
> Tel.: 956727976
>
> _______________________________________________
> http://www.vtiger.com/

-- 
Un saludo
Joe
TSolucio

JPL TSolució, S.L. garantiza la confidencialidad de los datos que obran en su poder y según lo estipulado por la LOPD
(Ley Orgánica 15/1999 de 13 de diciembre de Protección de Datos de Carácter Personal). Este mensaje se dirige
exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si no es vd. el destinatario
indicado, queda notificado de que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en
virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente
por esta misma vía y proceda a su destrucción. El correo electrónico vía Internet no permite asegurar la confidencialidad
de los mensajes que se transmiten ni su integridad o correcta recepción. JPL TSolució, S.L. no asume ninguna
responsabilidad por estas circunstancias.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20210223/1d13cfe8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 100289 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20210223/1d13cfe8/attachment-0001.png>


More information about the vtigercrm-developers mailing list