AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Optimizing Pointbase

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
rocky
Guest





PostPosted: Fri Jul 04, 2003 6:12 pm    Post subject: Optimizing Pointbase Reply with quote



We're building a company wide network monitoring system
in Java, and need some advice on the database design and
tuning.

The application will need to concurrently INSERT,
DELETE, and SELECT from our EVENT table as efficiently as
possible. We plan to implement an INSERT thread, a DELETE
thread, and a SELECT thread within our Java program.

The EVENT table will have several hundred million records
in it at any given time. We will prune, using DELETE, about
every five seconds to keep the active record set down to
a user controlled size. And one of the three queries will
be executed about every twenty seconds. Finally, we'll
INSERT as fast as we can in the INSERT thread.

Being new to PointBase, we need advice on

1) Server Tuning - Memory allocations, etc.
2) Table Tuning - Field types
3) Index Tuning - Are the indexes right
4) Query Tuning - Hints, etc.
5) Process Tuning - Better ways to INSERT and DELETE, etc.

Thanks, in advance, for any suggestions you can make :-)


The table is

//=====================================================================
// Database Creation Instructions
//=====================================================================
// CREATE TABLE "PBPUBLIC"."EVENT" (
// "ID" DECIMAL(10,0) PRIMARY KEY NOT NULL, -- 32-bit uint
// "IPSOURCE" DECIMAL(10,0) NOT NULL, -- 32-bit uint
// "IPDEST" DECIMAL(10,0) NOT NULL, -- 32-bit uint
// "UNIXTIME" DECIMAL(20,0) NOT NULL, -- 64-bit uint
// "TYPE" SMALLINT NOT NULL, -- 8-bit uint
// "DEVICEID" SMALLINT NOT NULL, -- 16-bit uint
// "PROTOCOL" SMALLINT NOT NULL -- 8-bit uint
// );
//
// CREATE INDEX "PBPUBLIC"."INDEX_SRC_DEST_TYPE"
// ON "PBPUBLIC"."EVENT" (
// "IPSOURCE", "IPDEST", "TYPE"
// );

The SELECTS are

private static String QueryString1 =
"SELECT ID,IPSOURCE,IPDEST,TYPE "+
"FROM EVENT "+
"WHERE ID >= ? "+
" AND ID <= ?";

private static String QueryString2 =
"SELECT COUNT(*),IPSOURCE "+
"FROM EVENT "+
"GROUP BY IPSOURCE "+
"ORDER BY 1 DESC";

private static String QueryString3 =
"SELECT COUNT(*),IPDEST "+
"FROM EVENT "+
"WHERE IPSOURCE = ? "+
" AND TYPE = ? "+
"GROUP BY IPDEST "+
"ORDER BY 1 DESC";

The DELETE is

private static String DeleteIDString =
"DELETE FROM EVENT "+
"WHERE ID < ?";
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.