> -----Original Message-----
> From: Alex Peshkoff via Firebird-devel [mailto:firebird-
> de...@lists.sourceforge.net]
> Sent: Tuesday, September 19, 2017 10:19 AM
> 
> > I'm curious about why there is no index on SEC$USERS.SEC$USER_NAME (*)
> 
> You are right - because it's virtual table.

Thanks for confirming, as expected although not what I had hoped for.
Having database with a couple of thousand users it doesn't feels optimized 
doing a natural scan every time I want to look up a user.


> > and about the reason as to why there is a difference between the usage of
> VARCHAR and CHAR on tables that seems related.
> 
> Use of CHAR for system tables is typical solution. What about related fields 
> in
> tables used by plugins - they are logically related, but separated by plugin 
> code
> and plugin is free to choose any format to store that data. One can write 
> plugin
> that stores user's list in non-firebird database or even in text file.

Understood and makes sense in that perspective.


> > And if there would have been an index, would a UNIQUE INDEX on SEC$USERS
> (SEC$USER_NAME, SEC$PLUGIN) been correct?
> 
> If virtual table _could_ have indices - yes, that pair is unique.

I see that I didn't express myself clearly, what I meant was that SEC$USER_NAME 
alone cannot be guaranteed unique if mixing different plugins, but I take it 
that's how you read it and answered accordingly. :-)

Thanks for your time Alex.

Regards,
Magnus Johansson

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to