Roland,

This actually helps a lot...thanx!

-Sheeri

On 9/23/08, Roland Bouman <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
>
> > So, a few questions as to how MySQL does it, and hopefully a discussion
> on
>
>
> I can say what I have seen in MySQL 5.1 - most notably sql/sql_show.cc
>
>
> > how Drizzle should do it:
> > 1) Are the information_schema tables views or temporary tables?
>
>
> As far as I know they are not "views" in the sense of named schema
> objects defined by a query expression.
> They are temporary tables in the sense that they are transient
> in-memory structures that are bound to the thread (the current
> connection).
> In C they are defined through a special struct in table.h
>
> typedef struct st_schema_table
> {
>   const char* table_name;
>   ST_FIELD_INFO *fields_info;
>   /* Create information_schema table */
>   TABLE *(*create_table)  (THD *thd, TABLE_LIST *table_list);
>   /* Fill table with data */
>   int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond);
>   /* Handle fileds for old SHOW */
>   int (*old_format) (THD *thd, struct st_schema_table *schema_table);
>   int (*process_table) (THD *thd, TABLE_LIST *tables, TABLE *table,
>                         bool res, LEX_STRING *db_name, LEX_STRING
> *table_name);
>   int idx_field1, idx_field2;
>   bool hidden;
>   uint i_s_requested_object;  /* the object we need to open(TABLE | VIEW)
> */
> } ST_SCHEMA_TABLE;
>
> I don't think this is the same as a table you create with CREATE TEMP
> TABLE.
>
>
> > 2) Where are the definitions stored for the information_schema tables?
>
>
> If you mean, the column layout that is defined as a list in the C code.
> The member
>
>   ST_FIELD_INFO *fields_info;
>
> of ST_SCHEMA_TABLE holds this list.
>
> The specific IS table layouts are hardwired in sql_show.cc
>
> For example, here is the column layout for I_S.processlist:
>
> ST_FIELD_INFO processlist_fields_info[]=
> {
>   {"ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Id", SKIP_OPEN_TABLE},
>   {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User", SKIP_OPEN_TABLE},
>   {"HOST", LIST_PROCESS_HOST_LEN,  MYSQL_TYPE_STRING, 0, 0, "Host",
>    SKIP_OPEN_TABLE},
>   {"DB", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Db", SKIP_OPEN_TABLE},
>   {"COMMAND", 16, MYSQL_TYPE_STRING, 0, 0, "Command", SKIP_OPEN_TABLE},
>   {"TIME", 7, MYSQL_TYPE_LONGLONG, 0, 0, "Time", SKIP_OPEN_TABLE},
>   {"STATE", 64, MYSQL_TYPE_STRING, 0, 1, "State", SKIP_OPEN_TABLE},
>   {"INFO", PROCESS_LIST_INFO_WIDTH, MYSQL_TYPE_STRING, 0, 1, "Info",
>    SKIP_OPEN_TABLE},
>   {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
>
> };
>
> > 3) How and when do the definitions get loaded?
>
>
> If you mean by "definition" the column layout, then I think it is
> loaded from the start on. The arrays of ST_FIELD_INFO are global
> variables.
> I am not entirely sure how and when the data is loaded.
>
>
> > I see these questions (particularly #3) as important particularly for
> > plugins, as some plugins will (heck, I'd probably argue that most of the
> > major ones *should*) add to the information_schema database.
>
>
> well, I believe that for information schema plugins, the definition is
> loaded at least upon INSTALL plugin, but also on server startup (for
> those plugins already installed)
>
> I hope this helps,
>
> Roland
> >
> > --
> > - Sheeri K. Cabral
> >
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~drizzle-discuss
> > Post to     : [email protected]
> > Unsubscribe : https://launchpad.net/~drizzle-discuss
> > More help   : https://help.launchpad.net/ListHelp
> >
> >
>
>
>
>
> --
> Roland Bouman
> http://rpbouman.blogspot.com/
>



-- 
- Sheeri K. Cabral

Note:  Currently I work for The Pythian Group (http://www.pythian.com/ ), a
remote DBA firm, and consulting would constitute a conflict of
interest.  However, I do recommend our work, and if you're looking for DBA
work (I do MySQL work, but they have great Oracle and SQL Server DBAs too)
right now, whether you need a few hours a week, or someone fulltime while
you continue a job search.

I have a webpage with tips on how to find a DBA:
http://sheeri.net/how-to-find-a-dba/
I can recommend http://www.toomanyconnections.com as a good site to find
MySQL (and Oracle) DBAs.
If you're looking for web design, I recommend the small business my husband
works for, http://www.digital-loom.com
I regret that I have no other information for any other type of position,
including developer, programmer and systems administrator.
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to