Re: [Maria-developers] review for MDEV-9143 (JSON).

2016-07-26 Thread Alexey Botchkov

I ran an additional test - created a table in MySQL with the VARCHAR column,

not JSON (as i did in MariaDB), and ran the same query.

So now MySQL had to parse the JSON and then look for path there.

--

MySQL [test]> select count(*) from jt2 where json_extract(j, 
"$.key1[1].key2")='IT';

+--+
| count(*) |
+--+
| 2000 |
+--+
1 row in set (5 min 28.54 sec)

---

Wow, I was surprised. 5.5 minutes against 7.6 seconds.

That i guess answers two questions:

   how rapid is RapidJSON?

   why MySQL bothers with the new JSON field type?


Best regards.

HF




25.07.2016 14:10, Alexey Botchkov wrote:

Hi, Sergei.


I've requested your review on this, here are few additional notes.

I ran some benchmarks comparing against MySQL5.7's JSON field type. 
And it seems


that the difference in performance is negligible.

For instance here are results for 20M rows with rather complicated JSON:


Space occupied:

MariaDB

-rw-rw. 1 hf hf 952000 Jul 25 13:08 jt1.MYD


MySQL

-rw-r-. 1 hf hf 944000 Jul 25 13:28 jt1.MYD


Query time:

MariaDB [test]> select count(*) from jt1 where json_extract(j, 
"$.key1[1].key2")='IT';

+--+
| count(*) |
+--+
| 2000 |
+--+
1 row in set (7.65 sec)


MySQL [test]> select count(*) from jt1 where json_extract(j, 
"$.key1[1].key2")='IT';

+--+
| count(*) |
+--+
| 2000 |
+--+
1 row in set (7.56 sec)


So again i can't think now of usecases where we have to store the JSON 
in some special


binary representation. Only thing i can figure out is that we'd like 
to be able to read the MySQL database


without any specific conversion.


Best regards.

HF




___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Sachin weekly report

2016-07-26 Thread Sachin Setia
Hello Sergei!
Weekly Report for 9 week of gsoc

Unique Long

1. Changed mysql_prepare_create function as suggested by you , now addition
of hash column will not be added in function start.
2. Sorted out problem of full_hidden detection now it is detected as soon
as it is found.

Where Optimization
1. In case of unique(a) if hash collides then it fetches the next record
and compares it and so on.
2. Now unique(a,b,c ..) also works and also in case of hash collusion  it
fetches the next record and compares it and so on.

Please review branch
https://github.com/SachinSetiya/server/tree/unique_index_where
The only problem i have is explain query fails , trying to solve it let you
know if something happens.
Regards
sachin

On Mon, Jul 25, 2016 at 1:34 AM, Sachin Setia 
wrote:

> Actually  i find that my_strnncoll  wil work :)
> Regards
> sachin
>
> On Mon, Jul 25, 2016 at 1:17 AM, Sachin Setia 
> wrote:
>
>> Hello Sergei,
>> I am getting one problem related to my_strcasecmp() function currently
>> this function does not allow
>> string comparison upto length l, is there any functon which can do
>> comparison upto length l, or should i
>> write mine.
>> Regards
>> sachin
>>
>> On Fri, Jul 22, 2016 at 9:56 PM, Sachin Setia 
>> wrote:
>>
>>> Hello Sergei,
>>> I have one problem my where optimization works for  query like
>>> select * from t1 where abc=1;
>>>
>>> but in query like
>>> select * from t1 where abc=(select xyz from t2 where xyz=1);
>>> does not work because in these query the charset is different from what
>>> used in
>>> t1 for inserting data and hence generation different hash for same data
>>> how i solve this problem.
>>> Regards
>>> sachin
>>>
>>> On Tue, Jul 19, 2016 at 5:52 PM, Sachin Setia >> > wrote:
>>>
 Just give me 3 days after you can review. yes I already merged with
 10.2.1 days ago.
 regards
 Sachin

 On Jul 19, 2016 17:28, "Sergei Golubchik"  wrote:

> Hi, Sachin!
>
> On Jul 19, Sachin Setia wrote:
> > Weekly Report for 8 week of gsoc
> >
> > 1 Changed the key flags as suggested by you.
>
> okay
>
> > 2 Now update will use only one buffer as suggested by you but there
> was one
> > problem some time offset can be
> > negative so i changed the field cmp_offset parameter from uint to
> long
>
> sure
>
> > 3 Still working on coding conventions.
> >
> > 4 I have made prototype for optimizing where for keys like unique(a)
> , it
> > is on branch
> > https://github.com/SachinSetiya/server/tree/unique_index_where
> >
> > Currently I am working on muliple keys like unique(a,b,c) i think
> this
> > should take 2-3 days  and edits suggested by you.
>
> sounds good.
> did you merge with 10.2.1?
>
> tell me when you'd want me to do another review.
>
> Regards,
> Sergei
> Chief Architect MariaDB
> and secur...@mariadb.org
>

>>>
>>
>
___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp