public void useIndexesToDuplicateTables() {
		System.out.println("Creating table duplicates based on indexes");
		logger.info("Creating table duplicates based on indexes");

		List<Table> listOfTables = new ArrayList<Table>(schema.getTables());
		for (Table table : listOfTables) {
			if (!table.isDeleted()) {
				TableStatus ts = db
						.getTable(table.getBaseRelationalTableName());

				List<IndexStatus> primaryKey = ts.getPrimaryKey();
				Map<String, List<IndexStatus>> indexesGrouped = ts
						.getIndexesGrouped();

				for (Map.Entry<String, List<IndexStatus>> indexesEntry : new ArrayList<Map.Entry<String, List<IndexStatus>>>(
						indexesGrouped.entrySet())) {

					List<IndexStatus> indexes = indexesEntry.getValue();

					// extract only the columns of the index
					List<String> indexesStr = new ArrayList<String>();
					boolean isUnique = false;
					for (IndexStatus index : indexes) {
						indexesStr.add(index.getColumn());
						isUnique = index.isUnique();
					}

					if (table.isSubsetOfKey(indexesStr)) {
						// if the current index is contained in the current
						// rowkey, then do not consider it for duplication
						indexesGrouped.remove(indexesEntry.getKey());
					} else {
						// Clone table
						Table clone = table.cloneTable();
						clone.setName(table.getName()
								+ conf.getClonedTableSeparator()
								+ indexesEntry.getKey());
						clone.setAlias(table.getName()
								+ conf.getClonedTableSeparator()
								+ indexesEntry.getKey());
						clone.setIndexName(indexesEntry.getKey());

						// Change row key
						clone.setAndEncodeKey(fromStringsToColumns(indexesStr,
								table));

						// If it is not unique index, then append the primary
						// key to make it unique
						if (!isUnique) {
							for (IndexStatus ix : primaryKey) {
								indexesStr.add(ix.getColumn());
							}
							// TO-DO Remove fromStringsToColumns
							clone.setAndEncodeKey(fromStringsToColumns(
									indexesStr, table));

						}

						schema.addTable(
								table.getName()
										+ conf.getClonedTableSeparator()
										+ indexesEntry.getKey(), clone);
					}
				}
			}
		}
	}