Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Rongcui Dong
    @rongcuid
    Anything else I can do?
    Sutou Kouhei
    @kou
    Could you create foreign keys to posts_copy manually and try again?
    I want reproducible data and SQL to investigate this.
    Rongcui Dong
    @rongcuid
    OH
    MariaDB [flarum]> ALTER TABLE posts ENABLE KEYS;
    Query OK, 0 rows affected, 1 warning (0.001 sec)
    
    MariaDB [flarum]> ALTER TABLE posts_copy ADD CONSTRAINT FOREIGN KEY (`discussion_id`) REFERENCES `discussions` (`id`) ON DELETE CASCADE; 
    ERROR 1005 (HY000): reference table [flarum.discussions] is not mroonga table
    Does Mroonga require all tables to be Mroonga?
    BTW, those tables are from the Flarum forum application. It's PHP/MySQL only.
    Rongcui Dong
    @rongcuid
    I can't seem to find a way to change all tables to Mroonga at once...
    Rongcui Dong
    @rongcuid
    Not even dropping every table and replacing with Engine=Mroonga works
    Rongcui Dong
    @rongcuid
    Does Mroonga even support foreign keys?
    I see a release note: https://mroonga.org/en/blog/2021/04/02/mroonga-11.01.html that mentions fixing a bug about FOREIGN KEY constraint. Not sure if it is the same problem -- but I can't test it, because there isn't a MariaDB build in the PPA
    We need to use Mroonga for a table and all foreign tables.
    Rongcui Dong
    @rongcuid
    I suspect I am hitting the bug mentioned in the release note
    I will swap MariaDB for MySQL and see
    BTW, any chance of adding MariaDB build into the PPA? Should I file an issue or something?
    Sutou Kouhei
    @kou
    We have the PPA package for Ubuntu 20.04 but doesn't for Ubuntu 22.04 yet.
    1 reply
    Rongcui Dong
    @rongcuid
    Ouch, I got MySQL into frozen mode
    Well, I can't figure out how to migrate to MySQL. I guess I will wait for the PPA first
    Rongcui Dong
    @rongcuid
    Can I build it myself? Any instructions?
    Rongcui Dong
    @rongcuid
    I am creating the debian package for 10.6 -> 22.04
    Hopefully it will work
    Well this is unfortunate... Don't know how to build task '/tmp/tmp.06Em4lelUz/mroonga/mroonga-12.08.tar.gz'
    Rongcui Dong
    @rongcuid
    Sorry to say that... but I can't build the package. I guess I will have to wait until an official Deb is released
    Rongcui Dong
    @rongcuid
    Any idea when the packaging might happen, or how I may help? The Official repo's version is 7.07, which is ancient. I am unable to set up the build process, either.
    Horimoto Yasuhiro
    @komainu8
    We are making PPA package for MariaDB 10.6 on Ubuntu jammy(22.04) now. We will deal with this as soon as possible.
    Rongcui Dong
    @rongcuid
    Thanks for the notice. I would suggest putting a guide for setting up development, though it can be me not finding the correct documentation.
    Rongcui Dong
    @rongcuid
    Why do I get this error? ERROR 1126 (HY000) at line 1: Can't open shared library '/usr/lib/mysql/plugin/ha_mroonga.so' (errno: 2, cannot open shared object file: No such file or directory)
    I know the correct path is /usr/lib/aarch64-linux-gnu/libmariadb3/plugin, and I have added it to ld.so.conf
    Rongcui Dong
    @rongcuid
    Well, I get the same foreign key constraint failure even with 12.07...
    小祺先生
    @lwq057
    There are several sorting fields that need to be updated frequently. I want to distinguish multiple index tables. When querying, one index is used to search keywords and the other index is used to sort results.

    Because some fields need to be updated frequently, you want to distinguish multiple tables.What is the solution to federate other tables in search?

    How to use join table in pgroonga_command select ? SQL like join tables.

    Sutou Kouhei
    @kou
    We don't want to spread the same topic to multiple places.
    Can we use pgroonga/pgroonga#254 for this topic?
    Pablo Hinojosa
    @Pablohn26_gitlab
    Hi, I am interested on Mroonga but I have read it is not transactional. How secure is (we cannot lose data) it?
    Sutou Kouhei
    @kou
    You must backup your data periodically by mysqldump, multiple replicas and/or other crash safe storage engine such as InnoDB.
    Tim Lebedkov
    @tim-lebedkov
    Am I iterating the results right? How can I get the value of a column?
    void key = NULL;
    grn_obj
    value = NULL;
    uint32_t key_size = 0;
    grn_obj textbuf;
    GRN_TEXT_INIT(&textbuf, 0);
    int row = 0;
    GRN_TABLE_EACH(&this->mw->ctx, res, 0, 0, id, &key, &key_size, &value, {
        grn_obj_get_value(&this->mw->ctx, value, 1, &textbuf);
        gchar *t = GRN_TEXT_VALUE(&textbuf);
        row++;
    });
    Horimoto Yasuhiro
    @komainu8

    @tim-lebedkov
    We can use GRN_TABLE_EACH_BEGIN(context, table, cursor, id) { ... }GRN_TABLE_EACH_END(context, cursor).
    I think GRN_TABLE_EACH_BEGIN(context, table, cursor, id) { ... }GRN_TABLE_EACH_END(context, cursor) is more useful than GRN_TABLE_EACH.

    We don't need to prepare the third argument cursor and the fourth argument id.
    Because these values allocate in the GRN_TABLE_EACH_BEGIN macro.

    In addition, we need to prepare column object.

    For example is as below.

    grn_obj *column = grn_obj_column(this->mw->ctx, res, your_column_name, your_column_name_length);
    
    grn_obj textbuf;
    GRN_TEXT_INIT(&textbuf, 0);
    
    int row = 0;
    GRN_TABLE_EACH_BEGIN(&this->mw->ctx, res, cursor, id) {
      GRN_BULK_REWIND(&textbuf);
      grn_obj_get_value(this->mw->ctx, column, id, &textbuf);
    
      printf("%s\n", GRN_TEXT_VALUE(&text_buf)); // This is debug code.
    
      gchar *t = GRN_TEXT_VALUE(&textbuf);
      row++;
    } GRN_TABLE_EACH_END(ctx, cursor);

    Please refer to https://groonga.org/docs/reference/api/grn_obj.html#c.grn_obj_column about grn_obj_column.

    Tim Lebedkov
    @tim-lebedkov
    It works! Thank you very much!
    Ibrahim Ahmad Jabar
    @baimtheelite

    Hi everyone, I want to search multiple tags in single query.

    I've read this documentation how to search tag.
    https://groonga.org/docs/tutorial/index.html#tag-search

    select --table Video --query tags:@Variety --output_columns _key,title

    but given the example, it only search for one tag

    I want to search multiple tag like Variety, Animation, Sport by single query

    how can i achieve that? thanks.

    Sutou Kouhei
    @kou

    select --table Video --query 'tags:@Variety tags:@Animation tags:@Sport --output_columns _key,title

    or

    select --table Video --match_columns tags --query 'Variety Animation Sport' --output_columns _key,title

    Ibrahim Ahmad Jabar
    @baimtheelite

    thanks, another question. how to write filter query params in http request?

    I succesfully deleted records in a table posts where published is true using groonga command

    delete posts --filter "published == true"

    but I don't know how to write in http request.

    Sutou Kouhei
    @kou

    http://SERVER:10041/d/delete?table=posts&filter=published+%3D%3D+true

    See also: https://groonga.org/docs/tutorial/network.html#how-to-send-a-command-to-an-http-server

    Ibrahim Ahmad Jabar
    @baimtheelite
    okay so it's using encoded url, thanks @kou you helped me a lot!
    Pablo Hinojosa
    @Pablohn26_gitlab

    You must backup your data periodically by mysqldump, multiple replicas and/or other crash safe storage engine such as InnoDB.

    one question. I have read Mroonga is not transactional but, is Mroonga in wrapper mode with InnoDB transactional?

    Sutou Kouhei
    @kou
    Partially, yes.
    Data is transactional but index isn't transactional. Because data is managed by InnoDB and index is managed by Mroonga.
    If you rollback a transaction, you need to recreate index to remove garbage data in index.
    cannadayr
    @cannadayr

    hello everyone, I had a performance/tuning related question.
    I am using a postgres database with pgroonga.
    I'm searching a table using some user supplied pattern, and ranking the results along with a number of predefined patterns.

    The problem is, is that searching using just the user supplied pattern is relatively fast (~2400 ms), but when adding in all the predefined patterns, it takes 14000+ms.
    At first I thought I could use triggers on table inserts to populate another table with the results of the predefined pattern matches, to amortize the search when the write-once record is added.
    This actually increased the time of the query, I suspect because joining to this table takes a significant amount of time (even with indices).

    Is there a way to index a column on some search pattern? Such that lookups of "foo" are very fast since they will be repeated often?
    I see there is grn_cache, but I am not sure if that applies. If it does, is there an example of using it with pgroonga (or something to get me started)?

    Thanks in advance.