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 

Two parts - Union + Order by query issue - Why can't I use EXEC DIRECT all the time?  XML

Forum Index » GridSQL - Developers
Author Message
ranga.gopalan@sorrisotech.com

Member

Joined: 23 Feb 2010 12:55:49
Messages: 19
Offline

Hi,

I'm using a version of GridSQL updated from the CVS source tree around May 26th.

I am running into an issue with a query executing successfully in Postgres and not on GridSQL - it works fine with "exec direct on all" - I had a question - Why can't I just run the query using "EXEC DIRECT on ALL '....'" via JDBC from my program - all it seems to do is to add an extra "Node" column to each row in the result set. This works fine in my tests with simple queries.

Is there any inherent problem with this approach? If the query cannot be supported by GridSQL, I would like to use 'exec direct on all' for a particular scenario within my application where I know the data is distributed across all the nodes (and the required Dimension join tables are replicated on all nodes) - Any reason why I shouldn't do this? The query will be limited using the LIMIT clause so there is no reason for huge numbers of rows to be returned to GridSQL by each node.

The "EXEC DIRECT on all" option would allow me to escape having to worry about syntax dependencies on GridSQL - However, probably I will need to send each query as a String literal (without using parameters) - I don't seem to be able to specify JDBC parameters to a prepared statement when using EXEC DIRECT.

It would ideal of course if the query worked with GridSQL and I didn't have to worry about the Exec Direct part.

Incidentally the query in question is:



I am trying to use this query to work around a Postgres bug with handling order by + limit clauses when dealing with partitioned tables - (In this scenario both t2 and t3 are child tables of a parent table) - Similar issue to that faced by the person here: http://stackoverflow.com/questions/2236776/efficient-querying-of-multi-partition-postgres-table

Here is the exception shown while executing the above query in the GridSQL console log:



My table structures:

Mason_S

Senior member

Joined: 1 Apr 2008 09:03:08
Messages: 380
Offline

Sorry, ORDER BY and LIMIT are currently not supported in subqueries, just in the top query. There is a large overlap of PostgreSQL and GridSQL SQL support, but not everything is supported.

Regards,

Mason
[WWW]
 
Forum Index » GridSQL - Developers
Go to:   
Powered by JForum 2.1.8 © JForum Team