matrix performance improvements
This commit is contained in:
parent
7194107900
commit
90247ac13c
2 changed files with 12 additions and 4 deletions
|
|
@ -31,6 +31,7 @@ my $quiet; # this line required
|
||||||
|
|
||||||
my $session = start(); # this line required
|
my $session = start(); # this line required
|
||||||
addAssetDiscoveryServiceAgain( $session );
|
addAssetDiscoveryServiceAgain( $session );
|
||||||
|
changeMatrixAttributeIndexing( $session );
|
||||||
|
|
||||||
# upgrade functions go here
|
# upgrade functions go here
|
||||||
|
|
||||||
|
|
@ -66,7 +67,13 @@ sub addAssetDiscoveryServiceAgain {
|
||||||
print "Done.\n" unless $quiet;
|
print "Done.\n" unless $quiet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
sub changeMatrixAttributeIndexing {
|
||||||
|
my $session = shift;
|
||||||
|
print "\tChanging Matrix attribute indexing..." unless $quiet;
|
||||||
|
$session->db->write("alter table MatrixListing_attribute drop primary key, add primary key(attributeId,matrixListingId)");
|
||||||
|
print "Done.\n" unless $quiet;
|
||||||
|
}
|
||||||
|
|
||||||
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -965,8 +965,8 @@ assetData.revisionDate
|
||||||
foreach my $result (@results){
|
foreach my $result (@results){
|
||||||
if($form->process("search")){
|
if($form->process("search")){
|
||||||
my $matrixListing_attributes = $session->db->buildHashRefOfHashRefs("
|
my $matrixListing_attributes = $session->db->buildHashRefOfHashRefs("
|
||||||
select value, fieldType, attributeId from MatrixListing_attribute as listing
|
select value, fieldType, attributeId from Matrix_attribute
|
||||||
left join Matrix_attribute using(attributeId)
|
left join MatrixListing_attribute as listing using(attributeId)
|
||||||
where listing.matrixListingId = ? order by value asc",
|
where listing.matrixListingId = ? order by value asc",
|
||||||
[$result->{assetId}],'attributeId');
|
[$result->{assetId}],'attributeId');
|
||||||
PARAM: foreach my $param (@searchParams_sorted) {
|
PARAM: foreach my $param (@searchParams_sorted) {
|
||||||
|
|
@ -1063,6 +1063,7 @@ sub www_getCompareListData {
|
||||||
[$category,$self->getId,@listingIds]
|
[$category,$self->getId,@listingIds]
|
||||||
) });
|
) });
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $result (@results){
|
foreach my $result (@results){
|
||||||
if($result->{fieldType} eq 'category'){
|
if($result->{fieldType} eq 'category'){
|
||||||
# Row starting with a category label shows the listing name in each column
|
# Row starting with a category label shows the listing name in each column
|
||||||
|
|
@ -1096,8 +1097,8 @@ sub www_getCompareListData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$jsonOutput->{ResultSet} = {Result=>\@results};
|
|
||||||
|
|
||||||
|
$jsonOutput->{ResultSet} = {Result=>\@results};
|
||||||
$session->http->setMimeType("application/json");
|
$session->http->setMimeType("application/json");
|
||||||
|
|
||||||
return JSON->new->encode($jsonOutput);
|
return JSON->new->encode($jsonOutput);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue