Navigation

    MemFireDB论坛

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    建表插入数据后,ID自增都是100是啥情况

    MemFireDB用户问答
    2
    4
    145
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      isware last edited by

      建表语句:

      create table common_trifle (
          "id" serial primary key,
          "name" text,
          "itemcount" bigint,
          "describe" text,
          "updatetime" bigint,
          "createtime" bigint
      );
      

      插入数据后的查询显示如下:
      cda592cf-8884-4538-9a5b-34504c996804-image.png
      使用平台的在线编辑器插入数据,请问是什么原因导致的?

      S 1 Reply Last reply Reply Quote 0
      • S
        starry @isware last edited by

        @isware 用dbeaver或者其他长连接的客户端使用的时候没有这个问题;
        目前建议是,要按1递增的时候,不要释放session;
        这块是代码写死了,暂时还没办法通过配置来调整,只能改的比100大,不能再小了
        我先记录下这个问题,后续版本也考虑下连接池这种情况,争取尽快下个版本改进下

        1 Reply Last reply Reply Quote 0
        • I
          isware @starry last edited by

          @starry 我使用的连接池,每次插入完了就把session释放了,有什么好的办法可以解决这个问题么?

          S 1 Reply Last reply Reply Quote 0
          • S
            starry @isware last edited by

            @isware
            memfiredb是个分布式数据库,为了减少rpc通信次数,这块强制设置成了100,每次重连的时候start以100步进的;
            使用线编辑器进行操作,每个请求都是重连的,所以sequences每次重新分配了

            I 1 Reply Last reply Reply Quote 0
            • First post
              Last post