Skip to content

Commit 3fffe56

Browse files
committed
added tracing for the foundset count
1 parent b75e289 commit 3fffe56

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

servoy_shared/src/com/servoy/j2db/dataprocessing/FoundSetManager.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,7 @@ public int getFoundSetCount(IFoundSetInternal fs)
19471947
{
19481948
return foundset.getSize();
19491949
}
1950-
1950+
long time = System.currentTimeMillis();
19511951
IDataServer ds = application.getDataServer();
19521952
Table t = (Table)foundset.getTable();
19531953
String transaction_id = getTransactionID(t.getServerName());
@@ -1956,6 +1956,12 @@ public int getFoundSetCount(IFoundSetInternal fs)
19561956
QuerySelect selectCountSQLString = sqlString.getSelectCount("n", true); //$NON-NLS-1$
19571957
IDataSet set = ds.performQuery(application.getClientID(), t.getServerName(), transaction_id, selectCountSQLString,
19581958
getTableFilterParams(t.getServerName(), selectCountSQLString), false, 0, 10, IDataServer.FOUNDSET_LOAD_QUERY);
1959+
if (Debug.tracing())
1960+
{
1961+
Debug.trace("Foundset count time: " + (System.currentTimeMillis() - time) + " thread: " + Thread.currentThread().getName() + ", SQL: " + //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
1962+
selectCountSQLString.toString());
1963+
}
1964+
19591965
if (set.getRowCount() > 0)
19601966
{
19611967
Object[] row = set.getRow(0);
@@ -1980,6 +1986,7 @@ public int getTableCount(ITable table)
19801986
{
19811987
try
19821988
{
1989+
long time = System.currentTimeMillis();
19831990
IDataServer ds = application.getDataServer();
19841991
String transaction_id = getTransactionID(table.getServerName());
19851992

@@ -1988,6 +1995,11 @@ public int getTableCount(ITable table)
19881995

19891996
IDataSet set = ds.performQuery(application.getClientID(), table.getServerName(), transaction_id, countSelect,
19901997
getTableFilterParams(table.getServerName(), countSelect), false, 0, 10, IDataServer.FOUNDSET_LOAD_QUERY);
1998+
if (Debug.tracing())
1999+
{
2000+
Debug.trace("Table count time: " + (System.currentTimeMillis() - time) + " thread: " + Thread.currentThread().getName() + ", SQL: " + //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
2001+
countSelect.toString());
2002+
}
19912003
if (set.getRowCount() > 0)
19922004
{
19932005
Object[] row = set.getRow(0);

0 commit comments

Comments
 (0)