Project

General

Profile

« Previous | Next » 

Revision 2724

Added by Jing Tao over 18 years ago

Using join query for more efficiency.

View differences:

MetacatReplication.java
1182 1182

  
1183 1183
      // Get correct docid that reside on this server according the requesting
1184 1184
      // server's replicate and data replicate value in xml_replication table
1185
      docsql.append("select docid, rev, doctype from xml_documents where (docid not in (select a.docid from xml_documents a, xml_revisions b where a.docid=b.docid and a.rev<=b.rev)) ");
1185
      docsql.append(dbAdapter.getReplicationDocumentListSQL());
1186
      //docsql.append("select docid, rev, doctype from xml_documents where (docid not in (select a.docid from xml_documents a, xml_revisions b where a.docid=b.docid and a.rev<=b.rev)) ");
1186 1187
      revisionSql.append("select docid, rev, doctype from xml_revisions ");
1187 1188
      // If the localhost is not a hub to the remote server, only replicate
1188 1189
      // the docid' which home server is local host (server_location =1)
1189 1190
      if (!serverList.getHubValue(server))
1190 1191
      {
1191
    	String serverLocationDoc = " and server_location = 1";
1192
    	String serverLocationDoc = " and a.server_location = 1";
1192 1193
        String serverLocationRev = "where server_location = 1";
1193 1194
        docsql.append(serverLocationDoc);
1194 1195
        revisionSql.append(serverLocationRev);

Also available in: Unified diff