1

My number of rows found with count(*) is a lot higher than the select(*). As the address is the unique index, I shouldn't have any duplicate addresses in my database. How could I find out which records are causing this?

Query 1:

Showing rows 0 - 24 (4613986 total, Query took 0.0004 seconds.)
SELECT * FROM `addresses` 

Query 2:

Your SQL query has been executed successfully.
SELECT COUNT(*) FROM addresses 

COUNT(*)    
4647734

My table:

CREATE TABLE `addresses` (
  `address` varchar(40) NOT NULL,
  `referral` varchar(40) NOT NULL,
  `wallet` varchar(30) DEFAULT NULL,
  `tovisit` int(3) DEFAULT '1',
  `lastvisited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `addresses`
  ADD UNIQUE KEY `address` (`address`);
Scripter
  • 558
  • 2
  • 8
  • 20

0 Answers0