anchor.diff:  			{
   				//category - on, state - off
   				sql2 = "SELECT * FROM users_categories_total ORDER BY total DESC LIMIT 20";
  -				sql3 = "SELECT * FROM users_products_total AS upt WHERE upt.pid IN (SELECT p.id FROM products AS p WHERE p.cid = " + category + ") ORDER BY upt.total DESC LIMIT 10";
  +				sql3 = "SELECT * FROM users_products_total AS upt WHERE upt.pid IN (SELECT p.id FROM products AS p JOIN products_total pt ON (pt.pid = p.id) WHERE p.cid = " + category + " ORDER BY  pt.total DESC LIMIT 10) ORDER BY upt.total DESC LIMIT 10";
   			}
   			else
   			{
  
positive.code: 			{
  				//category - off, state - on
  				sql2 = "SELECT * FROM users_total AS ut WHERE ut.uid IN (SELECT u.id FROM users AS u WHERE u.state = '" + state + "') ORDER BY ut.total LIMIT 20";
  				sql3 = "SELECT * FROM users_products_total AS upt WHERE upt.uid IN (SELECT u.id FROM users u WHERE u.state = '" + state + "') AND upt.pid IN (SELECT pt.pid FROM products_total AS pt ORDER BY pt.total LIMIT 10)";
  			}
  		}
  		else
  
negative.code: 	conn.commit();
  	conn.setAutoCommit(true);
  	*/
  	
  	//System.out.println("Report: ");
  
  	//System.out.println(SQL_1);
  	elapsed1 = (q1e - q1s) / 1000000.0;
  
  	//System.out.println("Elapsed 1: " + elapsed1);
  
  	//System.out.println();
  
  	System.out.println("Query 1 Time: " + elapsed1 + " ms");
  	out.println("<br>Query 1 Time: " + elapsed1 + " ms");
  	System.out.println();
  
  
  	//System.out.println(SQL_2);
  	elapsed2 = (q2e - q2s) / 1000000.0;
  	System.out.println("Query 2 Time: " + elapsed2 + " ms");
  	out.println("<br>Query 2 Time: " + elapsed2 + " ms");
  
  	//System.out.println("Elapsed 2: " + elapsed2);
  
  
  	//System.out.println();
  
  	//System.out.println(SQL_3);
  	elapsed3 = (q3e - q3s) / 1000000.0;
  	System.out.println("Query 3 Time: " + elapsed3 + " ms");
  	out.println("<br>Query 3 Time: " + elapsed3 + " ms");
  
  	//System.out.println("Elapsed 3: " + elapsed3);
  
  
  	//System.out.println();
  
  	long end = System.nanoTime();
  	double elapsed = (end - beg) / 1000000.0;
  
  	//System.out.println("Elapsed: "  + elapsed);
  
  	System.out.println("JSP time: "  + elapsed + " ms");
  	out.println("<br>JSP time: " + elapsed + " ms");
  	System.out.println();
  	
  }
  
  catch (SQLException e)
  