Hi all,
we're testing MonetDB performances in order to understand if it could be possible to use it as data mart in our BI software.
We're considering a set of queries executed in our test environment (CentOS 7, 32 GB RAM, 4 cpu).
All the executed queries have quite good performances (between 10 and 45 seconds) except the following one that is taking several minutes in order to be executed:
SELECT id, count(distinct value)
FROM table
GROUP BY id;
The table contains 100 millions of data. It has about 130 columns (varchar, int, bigint, smallint, tinyint, timestamp, datetime). We have no BLOB/CLOB/Text types.
The fields used in the query have these data types:
id: int
value: bigint
Can you suggest us any optimizations in order to have this query run faster? Do you know some possible reasons why it's so slow?
Kind Regards,
Alfio Bettini
The information contained in this message, together with any attachments, may be privileged and confidential and is intended for the use of the addressee(s) only. Any review, copying, use or distribution of this email by others (including any of its attachments) is strictly prohibited. If you are not the intended recipient, please destroy this email and its attachments and contact the sender immediately. This email was sent by EidosMedia SpA<http://www.eidosmedia.com>
Hello,
Database: MonetDB v11.27.11 (Jul2017-SP3)
I am experiencing a crash when attempting to use an aggregate function
inside a case statement in a having clause. Below is an example. One use
case for this is that I am computing a formula on aggregated data, and want
to ensure no divide by zero occurs. Are case statements in having clauses
supported? Thanks!
create table "t1" (
"id" int,
"c1" varchar(100),
"d1" int,
"d2" int
);
insert into "t1" values
(1, 'A', 50, 80),
(2, 'A', 200, 350),
(3, 'A', 89, 125),
(4, 'B', 4845, 13),
(5, 'B', 194, 597),
(6, 'C', 5636, 5802),
(7, 'C', 375, 3405),
(7, 'D', 365, 0),
(7, 'D', 87, 0);
-- Works
select
"c1",
sum("d1") as "d1",
sum("d2") as "d2"
from "t1"
group by "c1"
having sum("d1") < case when 5 > 10 then 500 else 400 end;
-- Works
select
"c1",
sum("d1")as "d1",
sum("d2") as "d2",
1.0 * sum("d1") / (1.0 * case when sum("d2") > 0 then sum("d2") else
null end) as "formula"
from "t1"
group by "c1";
-- Crashes
select
"c1",
sum("d1")as "d1",
sum("d2") as "d2",
1.0 * sum("d1") / (1.0 * case when sum("d2") > 0 then sum("d2") else
null end) as "formula"
from "t1"
group by "c1"
having (1.0 * sum("d1") / (1.0 * case when sum("d2") > 0 then sum("d2")
else null end)) > 1;
Looking in merovingian.log:
2018-01-29 14:47:15 ERR test[2879]: *** Error in `/usr/bin/mserver5':
double free or corruption (out): 0x00007f57200ea4b0 ***
2018-01-29 14:47:18 MSG merovingian[504]: database 'test' (2879) has
crashed (dumped core)
2018-01-29 14:49:35 MSG merovingian[504]: database 'test' has crashed after
start on 2018-01-29 14:42:36, attempting restart, up min/avg/max: 0s/0s/0s,
crash average: 1.00 0.20 0.07 (2-0=2)
2
Hi there,
Would someone like to pick up this wonderful opportunity to tell me that
I'm doing something silly? Please do.
In this loop, the cleanup take 4/5 of the total time. Is there a better way
of doing this?
loop(...) {
BAT *gn, *en, *hn;
BAT *idxn, *tn, *pn;
// tokenize, group, transform, append
// this takes 1/5 of the total loop time
if (BATutf8_tokenize(&tokens, s, delims, min_tok_len) !=
GDK_SUCCEED) goto fail;
if (BATgroup(&gn, &en, &hn, tokens, NULL, NULL, NULL, NULL) != GDK_SUCCEED)
goto fail;
idxn = BATconstant(0, TYPE_int, &idx, BATcount(en), TRANSIENT);
tn = BATproject(en,tokens);
pn = BATconvert(hn, NULL, TYPE_dbl, TRUE);
if (BATappend(br1,idxn,NULL,FALSE) != GDK_SUCCEED) goto fail;
if (BATappend(br2,tn,NULL,FALSE) != GDK_SUCCEED) goto fail;
if (BATappend(br3,pn,NULL,FALSE) != GDK_SUCCEED) goto fail;
// this takes 4/5 of the total loop time
BBPreclaim(idxn);
BBPreclaim(tn);
BBPreclaim(pn);
BBPreclaim(hn);
BBPreclaim(gn);
BBPreclaim(en);
BBPreclaim(tokens);
}
Dear all,
I try to install MonetDB with homebrew, but it failed with the error:
configure: error: libxml2 library not found but required for MonetDB5
But as far as I can tell, libxml2 is already installed, e.g.
$ brew list libxml2
/usr/local/Cellar/libxml2/2.9.7/bin/xml2-config
/usr/local/Cellar/libxml2/2.9.7/bin/xmlcatalog
/usr/local/Cellar/libxml2/2.9.7/bin/xmllint
/usr/local/Cellar/libxml2/2.9.7/include/libxml2/ (47 files)
/usr/local/Cellar/libxml2/2.9.7/lib/libxml2.2.dylib
/usr/local/Cellar/libxml2/2.9.7/lib/cmake/libxml2/libxml2-config.cmake
/usr/local/Cellar/libxml2/2.9.7/lib/pkgconfig/libxml-2.0.pc
/usr/local/Cellar/libxml2/2.9.7/lib/python2.7/ (6 files)
/usr/local/Cellar/libxml2/2.9.7/lib/ (3 other files)
/usr/local/Cellar/libxml2/2.9.7/share/aclocal/libxml.m4
/usr/local/Cellar/libxml2/2.9.7/share/doc/ (153 files)
/usr/local/Cellar/libxml2/2.9.7/share/gtk-doc/ (55 files)
/usr/local/Cellar/libxml2/2.9.7/share/man/ (4 files)
$ brew install libxml2
Warning: libxml2-2.9.7 already installed
Is there anything I can do to fix this?
Thanks a lot in advance!
Jennie
===============
Complete output of “brew install monetdb”
===============
$ brew install monetdb
Warning: You are using macOS 10.13.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Using the sandbox
==> Downloading https://www.monetdb.org/downloads/sources/Jul2017-SP3/MonetDB-11.27.11.tar.…
Already downloaded: /Users/jennie/Library/Caches/Homebrew/monetdb-11.27.11.tar.xz
==> ./configure --prefix=/usr/local/Cellar/monetdb/11.27.11 --enable-debug=no --enable-assert=no --enable-optimi
Last 15 lines from /Users/jennie/Library/Logs/Homebrew/monetdb/01.configure:
checking how to link with libiconv... -liconv
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing uuid_generate... none required
checking for CC_MD5_Update... yes
checking for CC_RIPEMD160_Update... no
checking for CC_SHA1_Update... yes
checking for CC_SHA224_Update... yes
checking for CC_SHA256_Update... yes
checking for CC_SHA384_Update... yes
checking for CC_SHA512_Update... yes
checking for pcre... yes
checking whether pcre comes with UTF-8 support... yes
checking for libxml2... no
configure: error: libxml2 library not found but required for MonetDB5
READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
https://github.com/Homebrew/homebrew-core/issues
Warning: You are using macOS 10.13.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
hey sreejith,
maybe this SO answer will be helfpul to you:
https://stackoverflow.com/questions/19661538/how-to-rename-a-table-in-monet…
hth. david
On 25 January 2018 at 08:56, <users-list-request(a)monetdb.org> wrote:
> Send users-list mailing list submissions to
> users-list(a)monetdb.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://www.monetdb.org/mailman/listinfo/users-list
> or, via email, send a message with subject or body 'help' to
> users-list-request(a)monetdb.org
>
> You can reach the person managing the list at
> users-list-owner(a)monetdb.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of users-list digest..."
>
>
> Today's Topics:
>
> 1. MonetDB-extend clang error: ld: unknown option: -soname
> (Ying Zhang)
> 2. Re: MonetDB-extend clang error: ld: unknown option: -soname
> (Sjoerd Mullender)
> 3. "brew install monetdb" failed due to "libxml2 library not
> found" (Ying Zhang)
> 4. MonetDB - question on rename table (Sharma, Sreejith)
> 5. Re: MonetDB - question on rename table (Stefan Manegold)
> 6. RE: MonetDB - question on rename table (Sharma, Sreejith)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 24 Jan 2018 15:56:19 +0100
> From: Ying Zhang <Y.Zhang(a)cwi.nl>
> To: Communication channel for MonetDB users <users-list(a)monetdb.org>
> Subject: MonetDB-extend clang error: ld: unknown option: -soname
> Message-ID: <1DD5C9B8-D559-4CD2-89E0-35CA729C9B67(a)cwi.nl>
> Content-Type: text/plain; charset=utf-8
>
> Dear all,
>
> I was trying to compile the regexp example in the MonetDB-extend repo on a Mac OS 10.13, but got an ?unknown option? error:
>
> $ make
> cc -fPIC -DPIC -o lib_regexp.so -shared regexp.o -L/usr/local/opt/openssl/lib -L/Users/jennie/scratch/monet-install/Jul2017/debug/lib -L/usr/local/Cellar/pcre/8.41/lib -lmonetdb5 -lbat -lpcre -Wl,-soname -Wl,lib_regexp.so
> ld: unknown option: -soname
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [lib_regexp.so] Error 1
>
> I looked around a bit. There are many discussions about clang error ld unknown option, but nothing specific for the ?-soname? option. Simply remove this option is not an option.
>
> Does anyone know how to fix/workaround this?
>
> Thanks a lot!
>
> Jennie
>
> ------------------------------
>
> Message: 2
> Date: Wed, 24 Jan 2018 16:34:38 +0100
> From: Sjoerd Mullender <sjoerd(a)acm.org>
> To: users-list(a)monetdb.org
> Subject: Re: MonetDB-extend clang error: ld: unknown option: -soname
> Message-ID: <78539081-3ab0-3b89-d22d-dbd12af4a6fa(a)acm.org>
> Content-Type: text/plain; charset="utf-8"
>
> On 24/01/18 15:56, Ying Zhang wrote:
>> Dear all,
>>
>> I was trying to compile the regexp example in the MonetDB-extend repo on a Mac OS 10.13, but got an ?unknown option? error:
>>
>> $ make
>> cc -fPIC -DPIC -o lib_regexp.so -shared regexp.o -L/usr/local/opt/openssl/lib -L/Users/jennie/scratch/monet-install/Jul2017/debug/lib -L/usr/local/Cellar/pcre/8.41/lib -lmonetdb5 -lbat -lpcre -Wl,-soname -Wl,lib_regexp.so
>> ld: unknown option: -soname
>> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>> make: *** [lib_regexp.so] Error 1
>>
>> I looked around a bit. There are many discussions about clang error ld unknown option, but nothing specific for the ?-soname? option. Simply remove this option is not an option.
>>
>> Does anyone know how to fix/workaround this?
>>
>> Thanks a lot!
>>
>> Jennie
>
> The question really is, how does one create a dynamically loaded module
> on MacOS? The file will be loaded dynamically by mserver, not linked
> into a program.
>
>
> --
> Sjoerd Mullender
>
>
Yep: that feature is not implemented.
-------- Original message --------From: "Sharma, Sreejith" <Sreejith.Sharma(a)harman.com> Date: 1/25/18 07:45 (GMT+01:00) To: Communication channel for MonetDB users <users-list(a)monetdb.org> Subject: MonetDB - question on rename table
All,
Any reason why we can’t do RENAME of table in MonetDB?
Regards,
Sreejith
Dear all,
I was trying to compile the regexp example in the MonetDB-extend repo on a Mac OS 10.13, but got an “unknown option” error:
$ make
cc -fPIC -DPIC -o lib_regexp.so -shared regexp.o -L/usr/local/opt/openssl/lib -L/Users/jennie/scratch/monet-install/Jul2017/debug/lib -L/usr/local/Cellar/pcre/8.41/lib -lmonetdb5 -lbat -lpcre -Wl,-soname -Wl,lib_regexp.so
ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib_regexp.so] Error 1
I looked around a bit. There are many discussions about clang error ld unknown option, but nothing specific for the “-soname” option. Simply remove this option is not an option.
Does anyone know how to fix/workaround this?
Thanks a lot!
Jennie
All,
Here is a quick question. I have compiled "MonetDB v11.27.9 (Jul2017-SP2)" version of source code and while running below sample SQL am finding an issue. Could anyone help me to trace issue? Is this due to the compiler version?
Issue Details:
While using SUM() or any function without an alias the header datatype returned is showing as HUGEINT for base INTEGER column, where as it should have been BIGINT. This is causing a failure in my BI application as it's having issues in identifying HUGEINT.
Below are the details.
Source Code Version : MonetDB v11.27.9 (Jul2017-SP2)
Linux OS Version : CentOS release 6.3 (Final)
C Compile Version : gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
Also, I see below note in MonetDB documentation. Which version of GCC should be appropriate for compilation with __128 bit integer.
Note: HUGEINT is only available since the Jul2015 release and on platforms with a C-compiler that supports the __int128 or __int128_t data type (e.g., recent gcc, clang, & icc on Linux or MacOS X)
Sample Table DDL :
CREATE TABLE INT_VALID (COL_INT INTEGER, COL_BIGINT BIGINT, COL_HUGEINT HUGEINT, COL_DOUBLE DOUBLE, COL_NUMERIC NUMERIC(10));
Compiled Version
sql>SELECT SUM(col_int) FROM INT_VALID;
mapi_query_part:36:SELECT SUM(col_int) FROM INT_VALID;
fetch next block: start at:10093
got next block: length:105
text:&1 4 1 1 1 2452
% DM_POS_TSV_MRT_P6A.L4 # table_name
% L3 # name
% hugeint # type
% 5 # length
[ 11110 ]
Binary Version
sql>SELECT SUM(col_int) FROM INT_VALID;
mapi_query_part:36:SELECT SUM(col_int) FROM INT_VALID;
fetch next block: start at:1168
got next block: length:105
text:&1 4 1 1 1 13998
% DM_POS_TSV_MRT_P6A.L4 # table_name
% L3 # name
% bigint # type
% 5 # length
[ 11110 ]
+---------+------------+--------------------------+-------------+
| col_int | col_bigint | col_double | col_numeric |
+=========+============+==========================+=============+
| 1111 | 1234567 | 1234.44 | 1111 |
| 2222 | 2345678 | 34355.66 | 2222 |
| 3333 | 3456789 | 66423.66 | 3333 |
| 4444 | 45678912 | 8765.66 | 4444 |
+---------+------------+--------------------------+-------------+
Regards,
Sreejith
Hello, my name Sergii. I hope this is right place for this message. In our
company we using MonetDB near 1 year and we have only one problem with it -
memory leak. We found only one dependence - if we making queries then
memory starts growing. I read "Memory footprint" article that MonetDB
excessively uses main memory for processing, but I thought it should stop
allocate memory after sometime but it's not. And looks like this allocated
memory is not gives some performance. What we do now is restarting monet
server every month. I found on mserver5 man-page parameter "gdk_vmtrim" but
I'm not 100% sure is it what we need and what correct way to apply this
parameter. Maybe MonetDB SQL has some function to unload no needed memory?
Maybe it's php/nodejs clients (from github.com/MonetDB repo) somehow cause
this memory leaks?
I will appreciate any help