Il 14/09/2011 19:34, Alex Nikitin ha scritto:
> Perhaps if I, or we can understand your application a little better,
> we could suggest better solutions, just remember that you are not the
> first person to have to solve these similar issues. I can help you if
> you want, glimpse over your database design and queries for a fresh
> look, i have fairly extensive php (and many other languages)
> programming experience, as well as database design and administration,
> system development and administration, optimization, security, caching
> (many other things, that don't directly pertain to this) though we
> should probably keep it off the list.
Table and queries are very simple.
Table is like this:
CREATE TABLE `TABLE1` (
`ID` int unsigned NOT NULL,
`Service` char(2) NOT NULL,
`Lang` char(2) NOT NULL,
`Text1` varchar(100) DEFAULT NULL,
`Char1` char(1) NOT NULL,
`Date1` date NOT NULL,
`Num1` int unsigned NOT NULL,
`Num2` smallint unsigned NOT NULL,
`Num3` smallint unsigned NOT NULL,
`Num4` tinyint unsigned NOT NULL,
`Num5` int unsigned NOT NULL,
`Num6` tinyint NOT NULL,
`Num7` int unsigned NOT NULL,
PRIMARY KEY (`ID`,`Service`,`Lang`),
KEY `index_1` (`Char1`),
KEY `index_2` (`Date1`),
KEY `index_3` (`Num1`),
KEY `index_4` (`Num2`),
KEY `index_5` (`Num3`),
KEY `index_6` (`Num4`),
KEY `index_7` (`Num5`),
KEY `index_8` (`Num6`),
KEY `index_9` (`Num7`),
KEY `index_10` (`Text1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
And this is an example query:
SELECT COUNT(*)
FROM TABLE1
WHERE Char1='A'
AND Num2=10
The WHERE clause can contain any indexed column.
Bye,
Marco
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php