Seemingly simple query...excruciating response time
I would use LEFT JOIN with vt502 on the left side

SELECT t502.* FROM
(
    SELECT PostalCode FROM t502locations
    GROUP BY PostalCode
    HAVING COUNT(PostalCode) &gt; 1
) vt502 LEFT JOIN t502locations t502
ON vt502.PostalCode = t502.PostalCode;


or

SELECT t502.* FROM
(
    SELECT PostalCode FROM t502locations
    GROUP BY PostalCode
    HAVING COUNT(PostalCode) &gt; 1
) vt502 LEFT JOIN t502locations t502
USING (PostalCode);


Chances are, the number of PostalCodes with multiple records is probably so high that the MySQL (MariaDB) Query Optimizer does not like.

At the very least, I would run OPTIMIZE TABLE t502locations; and try these queries.