EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

drop more than one table in one call  XML

Forum Index » GridSQL - Developers
Author Message
Ted_Yu_2

Member

Joined: 27 Aug 2010 17:22:19
Messages: 24
Offline

According to http://www.postgresql.org/docs/7.4/interactive/sql-droptable.html, multiple tables can be dropped in one call.
Is this supported by GridSQL ?
Andrei_M

Senior member

Joined: 19 Dec 2008 01:37:13
Messages: 116
Offline

No, this is not supported

Thanks
Andrei
Ted_Yu_2

Member

Joined: 27 Aug 2010 17:22:19
Messages: 24
Offline

Is it possible to provide asynchronous drop table operation ?
I.e. drop table request would return immediately without waiting.
Andrei_M

Senior member

Joined: 19 Dec 2008 01:37:13
Messages: 116
Offline

Well, it is easier to support multiple names in one "drop table" query.
Feel free to make the change and send us a patch.
First you need to update grammar src/com/edb/gridsql/parser/core/sql_extendb.jj
Then re-generate parser files and modify src/com/edb/gridsql/parser/SqlDropTable.java (update node databases) and src/com/edb/gridsql/metadata/SyncDropTable.java (update metadata)

Thanks
Andrei
Ted_Yu_2

Member

Joined: 27 Aug 2010 17:22:19
Messages: 24
Offline

I plan to add the following to sql_extendb.jj:
void TableNameList(PrintStream prn):
{}
{
(Identifier(prn)|<TEMPDOT_>Identifier(prn)|<PUBLICDOT_>Identifier(prn)|<QPUBLICDOT_>Identifier(prn))
(LOOKAHEAD(2) "," (Identifier(prn)|<TEMPDOT_>Identifier(prn)|<PUBLICDOT_>Identifier(prn)|<QPUBLICDOT_>Identifier(prn)))*
}

I am cvs novice. How can I produce a patch ?
I used this command to check out gridsql/apps:
cvs -z3 -d:pserver:anonymous@gridsql.cvs.sourceforge.net:/cvsroot/gridsql co -P apps

tyumac:gridsql-cvs tyu$ pwd
/Users/tyu/gridsql-cvs
tyumac:gridsql-cvs tyu$ cvs rdiff -c apps
cvs rdiff: No CVSROOT specified! Please use the `-d' option
cvs [rdiff aborted]: or set the CVSROOT environment variable.

I don't see -d option on http://www.manpagez.com/man/1/cvs/

Please advise
Andrei_M

Senior member

Joined: 19 Dec 2008 01:37:13
Messages: 116
Offline

Sorry, I have never used cvs directly. My IDE (Eclipse) has built-in cvs support and I use GUI for these tasks.
I guess you shoud either use
cvs -d:pserver:anonymous@gridsql.cvs.sourceforge.net:/cvsroot/gridsql rdiff ...
or define CVSROOT environment variable
export CVSROOT=:pserver:anonymous@gridsql.cvs.sourceforge.net:/cvsroot/gridsql

Thanks
Andrei
Ted_Yu_2

Member

Joined: 27 Aug 2010 17:22:19
Messages: 24
Offline

I plan to declare in sql_extenddb.jj:
void TableNameList(PrintStream prn):
{}
{
(Identifier(prn)|<TEMPDOT_>Identifier(prn)|<PUBLICDOT_>Identifier(prn)|<QPUBLICDOT_>Identifier(prn))
(LOOKAHEAD(2) "," (Identifier(prn)|<TEMPDOT_>Identifier(prn)|<PUBLICDOT_>Identifier(prn)|<QPUBLICDOT_>Identifier(prn)))*
}

This potentially allows temp table(s) to be specified along with other types of tables.
However, in SqlDropTable.execute() I see this:
if (temporary) {
client.deregisterTempTableWithSession(referenceName);
}
If tablename is expanded to a list (array), temporary and referenceName would also need to be expanded.

Please confirm whether this direction is the correct path.

Here is the motivation for my initiative:
The loop in dropTablesInternal() took 23 minutes for the flow run http://build.ciq.com/hudson/view/m2m-perf/job/m2m-staging-grid-incr-regr/8/console:
INFO [2010-08-30 15:08:28] (ExecUtil.java:257) - INFO [2010-08-30 22:08:28] (DatabasePartitioner.java:554) - dropTablesInternal: Dropping table: ROLLUP_1__20100407_tmp
....
INFO [2010-08-30 15:31:22] (ExecUtil.java:257) - INFO [2010-08-30 22:31:22] (DatabasePartitioner.java:554) - dropTablesInternal: Dropping table: ROLLUP_5__20100313_tmp

We want to reduce the amount of time dropping the tables.
Andrei_M

Senior member

Joined: 19 Dec 2008 01:37:13
Messages: 116
Offline

You just need to alter dropTable() definition and append ("," TableName(prn))*
No need for lookahead.
To re-generate parser files change to com/edb/gridsql/parser/core amd run make generate.
Then you should update SqlDropTable.java, start from visit() method. Update grammar rule in the comment. Just find generated dropTable class (parameter of visit()) and copy paste comment from there.

Thanks
Andrei
Ted_Yu_2

Member

Joined: 27 Aug 2010 17:22:19
Messages: 24
Offline

Please confirm make command syntax:
make GridSQL DEBUGINFO=-g
Andrei_M

Senior member

Joined: 19 Dec 2008 01:37:13
Messages: 116
Offline

This is correct if you making "Debug" version, with debugging symbols info included.
Leave off DEBUGINFO=-g to make "Release" version.

Thanks
Andrei
 
Forum Index » GridSQL - Developers
Go to:   
Powered by JForum 2.1.8 © JForum Team