IZ
Size: a a a
IZ
IZ
I
_cats_sync
AS s, _items
AS i WHERE s.cat_id
IN (109,152,153,156,157,158,214,163,166,140) AND s.status
= 1 AND s.p_status
= 1 AND s.id
= i.id
LIMIT 100;_cats_sync
(id
mediumint(8) unsigned NOT NULL,cat_id
smallint(5) unsigned NOT NULL,status
tinyint(1) unsigned NOT NULL,p_status
tinyint(1) NOT NULL_cats_sync
cat_id
,status
,p_status
,id
),id
(id
);DE
_cats_sync
AS s, _items
AS i WHERE s.cat_id
IN (109,152,153,156,157,158,214,163,166,140) AND s.status
= 1 AND s.p_status
= 1 AND s.id
= i.id
LIMIT 100;_cats_sync
(id
mediumint(8) unsigned NOT NULL,cat_id
smallint(5) unsigned NOT NULL,status
tinyint(1) unsigned NOT NULL,p_status
tinyint(1) NOT NULL_cats_sync
cat_id
,status
,p_status
,id
),id
(id
);EXPLAIN SELECT * FROM `_cats_sync` AS s, `_items` AS i WHERE s.`cat_id` IN (109,152,153,156,157,158,214,163,166,140) AND s.`status` = 1 AND s.`p_status` = 1 AND s.`id` = i.`id` LIMIT 100;
DE
_cats_sync
AS s, _items
AS i WHERE s.cat_id
IN (109,152,153,156,157,158,214,163,166,140) AND s.status
= 1 AND s.p_status
= 1 AND s.id
= i.id
LIMIT 100;_cats_sync
(id
mediumint(8) unsigned NOT NULL,cat_id
smallint(5) unsigned NOT NULL,status
tinyint(1) unsigned NOT NULL,p_status
tinyint(1) NOT NULL_cats_sync
cat_id
,status
,p_status
,id
),id
(id
);IZ
IZ
IZ
select
distinct p.cbsKey,
(еще полей 70 эдак)
from payments p
join paymentCardIndex pci on p.cbsKey = pci.cbsKey and p.documentDate = pci.documentDate
where ( p.payerSideReferencedAccountKey = ? or p.recipientSideReferencedAccountKey = ?)
create index IE_PAYMENTS_PAYER_REF_ACC on payments (payerSideReferencedAccountKey, documentDate);
create index IE_PAYMENTS_RECIPIENT_REF_ACC on payments (recipientSideReferencedAccountKey, documentDate);
S
select
distinct p.cbsKey,
(еще полей 70 эдак)
from payments p
join paymentCardIndex pci on p.cbsKey = pci.cbsKey and p.documentDate = pci.documentDate
where ( p.payerSideReferencedAccountKey = ? or p.recipientSideReferencedAccountKey = ?)
create index IE_PAYMENTS_PAYER_REF_ACC on payments (payerSideReferencedAccountKey, documentDate);
create index IE_PAYMENTS_RECIPIENT_REF_ACC on payments (recipientSideReferencedAccountKey, documentDate);
IZ
_cats_sync
AS s, _items
AS i WHERE s.cat_id
IN (109,152,153,156,157,158,214,163,166,140) AND s.status
= 1 AND s.p_status
= 1 AND s.id
= i.id
LIMIT 100;_cats_sync
(id
mediumint(8) unsigned NOT NULL,cat_id
smallint(5) unsigned NOT NULL,status
tinyint(1) unsigned NOT NULL,p_status
tinyint(1) NOT NULL_cats_sync
cat_id
,status
,p_status
,id
),id
(id
);status
,p_status
,cat_id
,id
),I
status
,p_status
,cat_id
,id
),IZ
IZ
IZ
cat_id
в конец можно сканировать диапазон индекса,I
cat_id
в конец можно сканировать диапазон индекса,IZ
IZ