Re: [h2] MySQL mode

2017-01-06 Thread Thomas Mueller Graf
Hi,

Actually, it is in the src/tools directory of H2. It was an attempt to
modularize the code. It was probably not a good idea. It is not included in
the H2 jar file, so you would need to manually add it to the classpath or
possibly your code.

Regards,
Thomas

On Fri, Jan 6, 2017 at 7:18 AM, Noel Grandin  wrote:

> Sorry, but org.h2.mode.FunctionsMySQL is not part of the H2 source code,
> you must have been looking at something else.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to h2-database+unsubscr...@googlegroups.com.
> To post to this group, send email to h2-database@googlegroups.com.
> Visit this group at https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Re: Index hints

2017-01-06 Thread Steve McLeod
Pull request submitted.

Surprisingly, while doing this I discovered we already accept Sybase's 
format for index hints, although the hints are ignored:

// Sybase compatibility with
// "select * from test (index table1_index)"



On Thursday, 5 January 2017 10:30:03 UTC+1, Thomas Mueller Graf wrote:
>
> Hi,
>
> > With this enhancement I'm trying to solve one of my own performance 
> issues.
>
> Sure, it sounds good to me. The "fail query" is a different feature, the 
> links were just FYI.
>
> > It is possible that no index in the list is chosen, in which case a 
> full table scan will be used.
>
> It looks like this is what MySQL is doing, so that's fine.
>
> Regards,
> Thomas
>
>
> On Thu, Jan 5, 2017 at 9:48 AM, Steve McLeod  > wrote:
>
>> MySQL syntax seems to be the popular option. I'll use that.
>>
>> Proposed Solution
>> ==
>>
>> I'll add this to the H2 SQL syntax:
>>
>> SELECT [TOP term] [DISTINCT | ALL] selectExpression FROM tableExpression 
>> [USE INDEX (indexList)] ...
>>
>> where indexList is defined as :
>> indexName [, indexName]*
>>
>> Each index in the list must exist, otherwise an INDEX_NOT_FOUND_1 (error 
>> code 42112) exception is thrown.
>>
>> Only indexes in the list will be used when choosing an index to use on 
>> the given tableExpression. There is no significance to order in this list.
>>
>> It is possible that no index in the list is chosen, in which case a full 
>> table scan will be used.
>>
>> To test this, I'll add test cases that check that the result of EXPLAIN 
>> ANALYZE indicates that a specified index is used (or is not used).
>>
>> > A related feature is to fail queries if no index is available.
>>
>> This sounds like a great idea, but I won't do this as part of this 
>> change. With this enhancement I'm trying to solve one of my own performance 
>> issues.
>>
>> Any feedback on this proposed solution?
>>
>>
>>
>> On Wednesday, 4 January 2017 13:13:15 UTC+1, Steve McLeod wrote:
>>>
>>> I'm considering attempting to add index hints to H2.
>>>
>>> Questions: 
>>> * Is this a good idea? Or is it  better to work on making the query 
>>> optimizer smarter at choosing the correct index?
>>> * Is Oracle's syntax preferable? Or MySQL's syntax? Or is there a better 
>>> syntax altogether?
>>>
>>> Oracle:
>>> SELECT /*+ INDEX (employees emp_department_ix)*/ 
>>>employee_id, department_id 
>>>   FROM employees 
>>>   WHERE department_id > 50;
>>>
>>> MySQL:
>>> SELECT * FROM table1 USE INDEX (col1_index,col2_index)
>>>   WHERE col1=1 AND col2=2 AND col3=3;
>>>
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to h2-database...@googlegroups.com .
>> To post to this group, send email to h2-da...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] MySQL mode

2017-01-06 Thread dmcnamara
Thanks for the responses!

Do you think it is worthwhile to open a PR to either: 
  compile a separate tools jar as part of the build
  or move the FunctionsMySQL.java file to the src/main directory,
  or a different solution?


On Friday, January 6, 2017 at 4:25:34 AM UTC-5, Thomas Mueller Graf wrote:
>
> Hi,
>
> Actually, it is in the src/tools directory of H2. It was an attempt to 
> modularize the code. It was probably not a good idea. It is not included in 
> the H2 jar file, so you would need to manually add it to the classpath or 
> possibly your code.
>
> Regards,
> Thomas
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] MySQL mode

2017-01-06 Thread Noel Grandin
yeah, just move it to the main directory​ is prob the easiest

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] H2 database how to use external library like apache.commons

2017-01-06 Thread BB23850


I was trying to use H2 Database. I want to call methods in Apache Commons 
Library i.e. commons-maths3.jar. I created variable 
CLASSPATH=d:\H2\commons-maths3.3.6.1.jar and reloaded through H2.bat.


But when accessing the library method with the following:

CREATE ALIAS sd for 
"org.apache.commons.math3.stat.descriptive.moment.StandardDeviation";


I am getting 90086 error.

Class "org.apache.commons.math3.stat.descriptive.moment" not found; SQL 
statement: create alias sd for 
"org.apache.commons.math3.stat.descriptive.moment.StandardDeviation" 
[90086-193] 90086/90086

Also, please suggest me how to know that a library is accessible to H2 
something like DESCRIBE StandardDeviation.

I hope if this method succeeds then I should be able to use other library 
like Lucene, ActiveMQ or Kafka etc.

Thanks and regards

BB23850

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.