← Back to team overview

maria-developers team mailing list archive

Re: bd98ef106c8: MDEV-17554 Auto-create new partition for system versioned tables with history partitioned by INTERVAL/LIMIT

 

Sergei,

On Wed, Feb 19, 2020 at 8:27 PM Sergei Golubchik <serg@xxxxxxxxxxx> wrote:
>
> Hi, Aleksey!
>
> On Feb 18, Aleksey Midenkov wrote:
> > On Mon, Feb 17, 2020 at 8:23 PM Sergei Golubchik <serg@xxxxxxxxxxx> wrote:
> > > On Feb 17, Aleksey Midenkov wrote:
> > > > On Sat, Nov 9, 2019 at 12:03 AM Sergei Golubchik <serg@xxxxxxxxxxx> wrote:
> > > > >
> > > > > 1.
> > > > > It should be possible to enable/disable auto-creation.  For
> > > > > example, CREATE TABLE ... PARTITION BY SYSTEM_TIME ...
> > > > > PARTITIONS AUTO; this solves few problems at once:
> > > > > * a user explicitly tells when auto-creation should work
> > > >
> > > > Done.
> > > >
> > > > > * you don't need to worry "if this name is already occupied"
> > > >
> > > > I have to. There can be partitions created by hand.
> > >
> > > Here I meant that partitions can be either AUTO or manually created.
> > > So if a user had specified AUTO there can be no manually added
> > > partitions.  Which makes the implementation simpler.
> >
> > I believe current implementation is better: compatibility with old
> > syntax and existing tables require just to add one keyword to make
> > things work. I don't believe one little loop makes it more complex.
> > OTOH forced syntax difference is something users nor programmers don't
> > like.
>
> I'm just saying, the implementation can be made notably simpler if we
> won't allow manually and automatically created partitions in the same
> table. But if you want to support that and solve problems that it
> creates  - okay.
>
> > > > > * you can define that these partitions can never overflow (for
> > > > > INTERVAL)
> > > > > * if you know that AUTO partitions never overflow, you can keep
> > > > > the old behavior for ALTER TABLE ADD PARTITION.
> > > >
> > > > Fast ADD is performance consideration. Making data copy on
> > > > auto-creation is feature killer.
> > >
> > > Agree. I meant that if partitions never overflow, then ADD will
> > > never need copying.
> >
> > Agree. The old behavior will be returned in MDEV-21747.
>
> Great, I'll do a new review when it's done, then.
>
> > > Using the parser in the main thread is easy, we do that in many
> > > places. It would be the last reason for me to do a separate thread.
> >
> > I'm not familiar with that. Can we run SQL command from another SQL
> > command easily?
>
> Not "run SQL command" yet. But "parse SQL command" — yes.
> Just grep for "parse_sql" for examples.

Yes, I'm familiar with such isolated parsing. I'm not familiar with
isolated parsing and running, that's what I meant and what the code
does. It looked simplest way to run in separate thread to me like any
connection does.

>
> Regards,
> Sergei
> VP of MariaDB Server Engineering
> and security@xxxxxxxxxxx



-- 
All the best,

Aleksey Midenkov
@midenok


References