Tarantool development patches archive
 help / color / mirror / Atom feed
From: Mergen Imeev <imeevma@tarantool.org>
To: Konstantin Osipov <kostja.osipov@gmail.com>
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v4 2/2] box: introduce _vsession_settings sysview
Date: Wed, 27 Nov 2019 13:52:06 +0300	[thread overview]
Message-ID: <20191127105206.GA16682@tarantool.org> (raw)
In-Reply-To: <CAPZPwLqSv8=H_tv+Yakh=Dai-n0K6KfKErXa2E3S+9uTAEdgtA@mail.gmail.com>

On Wed, Nov 27, 2019 at 01:34:32PM +0300, Konstantin Osipov wrote:
> Pragmas are of course a dead end, but pragmas themselves are
> unimportant, so it's still unclear why one should bother about them,
> as opposed to, for example, caring about foreign key checks for all
> front ends.
> 
> But fine, assuming one wants to remove prgamas, adding extra overhead
> to session management is a bad idea. One could have a global sysview
> _vsettings with all the settings, perhaps even ones from box.cfg, and
> that would be enough.

Hi! Thanks for the review. However, I think you are a little
wrong. We do not save these settings anywhere except for the
struct session. When a user reads from the space, it creates
tuples on the fly and passes them to the user. All of this can
actually be read from the commit-message:


box: introduce _vsession_settings sysview

This patch creates the _vsession_settings sysview. This sysview
contains names and values of the session settings.

This sysview creates tuples on the fly using its own get() and
create_iterator() methods. This allows us to get a tuple without
having to save it anywhere. But this means that every time we get
a tuple from this system view, it is a new tuple, even if they
look the same:

tarantool> v = box.space._vsession_settings
tarantool> v:get({'sql_default_engine'}) ~= v:get({'sql_default_engine'})
---
- true
...

Currently, only SQL settings can be extracted from this sysview,
since the only session settings are SQL settings.

Part of #4511

@TarantoolBot document
Title: _vsession_settings system view
_vsession_settings sysview is used to get the current session
settings. List of currently available session settings:

sql_default_engine
sql_defer_foreign_keys
sql_full_column_names
sql_recursive_triggers
sql_reverse_unordered_selects

Debug build also have debug settings that could be obtained from
this sysview:

sql_parser_trace
sql_select_trace
sql_trace
sql_vdbe_addoptrace
sql_vdbe_debug
sql_vdbe_eqp
sql_vdbe_listing
sql_vdbe_trace
sql_where_trace

Example of usage:
tarantool> box.space._vsession_settings:get({'sql_default_engine'})
---
- ['sql_default_engine', 'memtx']
...

tarantool> box.space._vsession_settings:select()
---
- - ['sql_default_engine', 'memtx']
- ['sql_defer_foreign_keys', false]
- ['sql_full_column_names', false]
- ['sql_recursive_triggers', true]
- ['sql_reverse_unordered_selects', false]
...

tarantool> box.space._vsession_settings:select('sql_g', {iterator='LE'})
---
- - ['sql_full_column_names', false]
- ['sql_defer_foreign_keys', false]
- ['sql_default_engine', 'memtx']
...

  reply	other threads:[~2019-11-27 10:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 12:11 [Tarantool-patches] [PATCH v4 0/2] " imeevma
2019-11-23 12:11 ` [Tarantool-patches] [PATCH v4 1/2] sysview: make get() and create_iterator() methods virtual imeevma
2019-11-23 12:12 ` [Tarantool-patches] [PATCH v4 2/2] box: introduce _vsession_settings sysview imeevma
2019-11-24 15:27   ` Vladislav Shpilevoy
2019-11-27  9:53     ` Mergen Imeev
2019-11-27 23:14       ` Vladislav Shpilevoy
2019-11-26 21:12   ` Konstantin Osipov
2019-11-27  5:15     ` Kirill Yukhin
2019-11-27 10:34       ` Konstantin Osipov
2019-11-27 10:52         ` Mergen Imeev [this message]
2019-11-27 11:05           ` Konstantin Osipov
2019-11-27 11:18             ` Mergen Imeev
2019-11-27 11:37               ` Konstantin Osipov
2019-11-27 12:12                 ` Mergen Imeev
2019-11-28  8:46 [Tarantool-patches] [PATCH v4 0/2] Introduce " imeevma
2019-11-28  8:46 ` [Tarantool-patches] [PATCH v4 2/2] box: introduce " imeevma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191127105206.GA16682@tarantool.org \
    --to=imeevma@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v4 2/2] box: introduce _vsession_settings sysview' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox