mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 19:30:12 +01:00
improved index for attachment table
Change-Id: Ib333bbcba35a27eccdba10b18dd1a32a775f82d0 Signed-off-by: SJ <sj@acts.hu>
This commit is contained in:
parent
d04776fb5f
commit
3b60f279ea
@ -90,8 +90,7 @@ create table if not exists `attachment` (
|
|||||||
) Engine=InnoDB;
|
) Engine=InnoDB;
|
||||||
|
|
||||||
create index `attachment_idx` on `attachment`(`piler_id`);
|
create index `attachment_idx` on `attachment`(`piler_id`);
|
||||||
create index `attachment_idx2` on `attachment`(`sig`);
|
create index `attachment_idx2` on `attachment`(`sig`, `size`, `ptr`);
|
||||||
create index `attachment_idx3` on `attachment`(`ptr`);
|
|
||||||
|
|
||||||
drop view if exists `v_attachment`;
|
drop view if exists `v_attachment`;
|
||||||
create view `v_attachment` AS select `id` as `i`, `piler_id`, `attachment_id`, `ptr`, (select count(*) from `attachment` where `ptr`=`i`) as `refcount` from `attachment`;
|
create view `v_attachment` AS select `id` as `i`, `piler_id`, `attachment_id`, `ptr`, (select count(*) from `attachment` where `ptr`=`i`) as `refcount` from `attachment`;
|
||||||
|
Loading…
Reference in New Issue
Block a user