Jigal van Hemert napsal(a):
| 1 | SIMPLE | o | ALL | NULL | NULL |
NULL | NULL | 20402 | Using temporary; Using
filesort |
Well, this is a clue IMHO... no suitable indexes in o could be found
to use
in this query...
yea, but I use a lot of indexes and I don't know how to set it better.
Bellow there are create table info so could you tell me what do you
think would be bad, please?
CREATE TABLE `order_acl` (
`objid` bigint(20) unsigned NOT NULL default '0',
`gid` bigint(20) unsigned NOT NULL default '0',
PRIMARY KEY (`objid`,`gid`),
KEY `gid` (`gid`),
KEY `gid_2` (`gid`,`objid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin2;
CREATE TABLE `orders` (
`id` bigint(20) unsigned NOT NULL default '0',
`orderid` bigint(20) unsigned NOT NULL default '0',
`serialid` tinyint(3) unsigned NOT NULL default '0',
`cancel` tinyint(3) unsigned NOT NULL default '0',
`authorized` tinyint(4) unsigned NOT NULL default '0',
`createdby` bigint(20) unsigned NOT NULL default '0',
`createdon` bigint(20) unsigned NOT NULL default '0',
`changedby` bigint(20) unsigned NOT NULL default '0',
`changedon` bigint(20) unsigned NOT NULL default '0',
`brandid` bigint(20) unsigned NOT NULL default '0',
`productid` bigint(20) unsigned NOT NULL default '0',
`producttype` varchar(32) NOT NULL default '0',
`warrantyid` bigint(20) unsigned NOT NULL default '0',
`customerid` bigint(20) unsigned NOT NULL default '0',
`scheduleid` bigint(20) unsigned NOT NULL default '0',
`pnc` varchar(32) NOT NULL default '',
`seno` varchar(32) NOT NULL default '',
`note` text NOT NULL,
`descr` text NOT NULL,
`workdescr` text NOT NULL,
`worktime` int(10) unsigned NOT NULL default '0',
`workprice` int(10) unsigned NOT NULL default '0',
`materialprice` int(10) unsigned NOT NULL default '0',
`transprice` int(10) unsigned NOT NULL default '0',
`papernumber` int(10) unsigned NOT NULL default '0',
`builtin` tinyint(3) unsigned NOT NULL default '0',
`dobuiltin` tinyint(3) unsigned NOT NULL default '0',
`completed` tinyint(3) unsigned NOT NULL default '0',
`express` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `brandid` (`brandid`),
KEY `productid` (`productid`),
KEY `customerid` (`customerid`),
KEY `orderid` (`orderid`),
KEY `createdby` (`createdby`,`changedby`),
KEY `completed` (`completed`,`express`),
KEY `orders`
(`createdby`,`changedby`,`customerid`,`productid`,`brandid`,`scheduleid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin2;
--
Regards, Pavel Novak
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]