From 1e586e715333d03c524c811c9a6c99dc3661718b Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 10 May 2002 16:04:39 +0000 Subject: [PATCH] Table optimisation : aqorders. SPEEEEEEEEEEEEEEEDs up receive.pl. try to add indexes on production tables, and you will see... Quite proud of this 2 lines patch ;-) --- database.mysql | 72 ++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/database.mysql b/database.mysql index 497c365c4a..2eaf5f4077 100644 --- a/database.mysql +++ b/database.mysql @@ -128,46 +128,50 @@ CREATE TABLE aqorderdelivery ( # Table structure for table 'aqorders' # CREATE TABLE aqorders ( - ordernumber int(11) DEFAULT '0' NOT NULL auto_increment, - biblionumber int(11), + ordernumber int(11) NOT NULL auto_increment, + biblionumber int(11) default NULL, title text, - requisitionedby varchar(10), - authorisedby varchar(10), - booksellerid varchar(10) DEFAULT '' NOT NULL, - deliverydays smallint(6), - followupdays smallint(6), - numberfollowupsallowed smallint(6), - numberfollowupssent smallint(6), - entrydate date, - dateprinted date, - quantity smallint(6), - currency char(3), - listprice decimal(28,6), - totalamount decimal(28,6), - datereceived date, + requisitionedby varchar(10) default NULL, + authorisedby varchar(10) default NULL, + booksellerid varchar(10) NOT NULL default '', + deliverydays smallint(6) default NULL, + followupdays smallint(6) default NULL, + numberfollowupsallowed smallint(6) default NULL, + numberfollowupssent smallint(6) default NULL, + entrydate date default NULL, + dateprinted date default NULL, + quantity smallint(6) default NULL, + currency char(3) default NULL, + listprice decimal(28,6) default NULL, + totalamount decimal(28,6) default NULL, + datereceived date default NULL, booksellerinvoicenumber text, - freight decimal(28,6), - unitprice decimal(28,6), - quantityreceived smallint(6), + freight decimal(28,6) default NULL, + unitprice decimal(28,6) default NULL, + quantityreceived smallint(6) default NULL, sourced text, - cancelledby varchar(10), - quantityreceiveddamaged smallint(6), - datecancellationprinted date, + cancelledby varchar(10) default NULL, + quantityreceiveddamaged smallint(6) default NULL, + datecancellationprinted date default NULL, notes text, supplierreference text, purchaseordernumber text, - subscription tinyint(1), - subscriptionfrom date, - subscriptionto date, - serialid varchar(30), - basketno int(11), - biblioitemnumber int(11), - timestamp timestamp(14), - rrp decimal(13,2), - ecost decimal(13,2), - gst decimal(13,2), - PRIMARY KEY (ordernumber) -); + subscription tinyint(1) default NULL, + subscriptionfrom date default NULL, + subscriptionto date default NULL, + serialid varchar(30) default NULL, + basketno int(11) default NULL, + biblioitemnumber int(11) default NULL, + timestamp timestamp(14) NOT NULL, + rrp decimal(13,2) default NULL, + ecost decimal(13,2) default NULL, + gst decimal(13,2) default NULL, + PRIMARY KEY (ordernumber), + KEY booksellerid (booksellerid), + KEY biblionumber (biblionumber), + KEY biblioitemnumber (biblioitemnumber), + KEY biblioitemnumber_2 (biblioitemnumber) +) TYPE=MyISAM; # # Table structure for table 'biblio' -- 2.39.5