git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@111618 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d52833272e
commit
af8419ac0f
|
@ -35,7 +35,15 @@ public class DatabaseUtils {
|
|||
|
||||
private String primaryK;
|
||||
private String primaryKColName;
|
||||
|
||||
|
||||
public static long estimateNumberofRows(String table, SessionFactory dbconnection) throws Exception{
|
||||
List<Object> explain = DatabaseFactory.executeSQLQuery("EXPLAIN SELECT * FROM "+table, dbconnection);
|
||||
String explained = "" + explain.get(0);
|
||||
explained = explained.substring(explained.lastIndexOf("rows="));
|
||||
explained = explained.substring(explained.indexOf('=') + 1, explained.indexOf(' '));
|
||||
return Long.parseLong(explained);
|
||||
}
|
||||
|
||||
private void getPrimaryKeys(List<Object> keys, String table) {
|
||||
int keynum = 0;
|
||||
if (keys != null)
|
||||
|
|
Loading…
Reference in New Issue