| « gettext - forme de plural | On PHP performance... » |
Link: /blog1.php/2008/10/06/index-the-full-length-of-a-column
Following my old post from 2008 I give you once again the query to verify the amount of uniqueness of a column:
SET @firstXchars = 2;
SELECT COUNT(*) AS `total values / NULL`,
COUNT(DISTINCT column_name) AS `distinct values / distinct left X chars`,
COUNT(*) - COUNT(DISTINCT column_name) AS `non distinct / non distinct left X chars`
FROM table_name
UNION
SELECT NULL,
COUNT(DISTINCT LEFT(column_name, @firstXchars)),
COUNT(*) - COUNT(DISTINCT LEFT(column_name, @firstXchars))
FROM table_name
Now I can delete a text file (where I was storing this query)... my PCH-A110 is getting messy.
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Recent comments