Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-29 Thread Geert Vanderkelen

James Bennett wrote:
> On 6/28/06, Geert Vanderkelen <[EMAIL PROTECTED]> wrote:
>> I'm also not sure how you going to use the full text
>> searching unless there is a patch now too..
> 
> For just querying against the DB, having fulltext indexes set up
> should be sufficient; the DB's query optimizer will recognize that
> there's an index for the table/column you're querying on and use that.
> 

Not true for FULLTEXT indexes. These needs the usuage of special functions 
like:  MATCH (col1) AGAINST (expr)

In Django you need to set the field lookup type explained here:
   http://www.djangoproject.com/documentation/db_api/#field-lookups

As far as I can see, only BOOLEAN MODE is supported, which will be used more 
  frequently anyway.

Cheers,

Geert

-- 
Geert Vanderkelen, Support Engineer, MySQL AB

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread Adrian Holovaty

On 6/28/06, Geert Vanderkelen <[EMAIL PROTECTED]> wrote:
> ALTER TABLE appname_modelname ENGINE=MyISAM;
>
> and you're done. That's something you'll have to do afterward doing a
> 'syncdb' or sqlreset indeed.

You can put that ALTER TABLE statement in the "sql" directory within
your app, named in an appropriate way, and it'll get executed
automatically for "syncdb" and "sqlreset", etc.

See here:

http://www.djangoproject.com/documentation/model_api/#providing-initial-sql-data

Also, I've written this up as a FAQ -- thanks for asking the question.

http://www.djangoproject.com/documentation/faq/#how-do-i-add-database-specific-options-to-my-create-table-statements-such-as-specifying-myisam-as-the-table-type

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread James Bennett

On 6/28/06, Geert Vanderkelen <[EMAIL PROTECTED]> wrote:
> I'm also not sure how you going to use the full text
> searching unless there is a patch now too..

For just querying against the DB, having fulltext indexes set up
should be sufficient; the DB's query optimizer will recognize that
there's an index for the table/column you're querying on and use that.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread James Bennett

On 6/28/06, Geert Vanderkelen <[EMAIL PROTECTED]> wrote:
> Think you made a typo there or so..
>
> MyISAM -> none transactional
> InnoDB and NDBCluster (and BDB) -> transactional

Yeah. Too much traveling, too much coding, too little sleep :(

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread Geert Vanderkelen

Hi Andrew,

[EMAIL PROTECTED] wrote:
> Hi,
> 
> A total newbie question here, but is there a way to specify the engine
> I would prefer when defining models for applications. Would really
> prefer MyISAM, but MySQL keeps creating InnoDB when the tables are
> automatically created. (Reason: MyISAM supports full-text searching
> whereas InnoDB doesn't).

I think this already came up somewhere in a bug report/feature request.

> Please don't tell me I'll have to create tables manually to achieve
> this!

Unless I missed something, yup you have. But not really in the end.

ALTER TABLE appname_modelname ENGINE=MyISAM;

and you're done. That's something you'll have to do afterward doing a 
'syncdb' or sqlreset indeed.

InnoDB tables are needed to take advantage of transactions. With MyISAM you 
don't have that. I'm also not sure how you going to use the full text 
searching unless there is a patch now too..

Cheers,

Geert

-- 
Geert Vanderkelen, Support Engineer, MySQL AB

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread Geert Vanderkelen

Hi James,

James Bennett wrote:
> On 6/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> A total newbie question here, but is there a way to specify the engine
>> I would prefer when defining models for applications. Would really
>> prefer MyISAM, but MySQL keeps creating InnoDB when the tables are
>> automatically created. (Reason: MyISAM supports full-text searching
>> whereas InnoDB doesn't).
> 
> You won't have to create tables manually, in one sense. However,
> you'll end up doing a bit of indirection; Django will happily output
> to a terminal the SQL it's going to execute to create the tables[1],
> so you can use that, edit it to specify the table type you want, and
> then source the file from inside MySQL.
> 
> Also, keep in mind that not using MyISAM means losing transactions.

Think you made a typo there or so..

MyISAM -> none transactional
InnoDB and NDBCluster (and BDB) -> transactional

Using InnoDB you can do transaction, using MyISAM not.

Cheers,

Geert

-- 
Geert Vanderkelen, Support Engineer
MySQL GmbH, Germany, www.mysql.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread James Bennett

On 6/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> A total newbie question here, but is there a way to specify the engine
> I would prefer when defining models for applications. Would really
> prefer MyISAM, but MySQL keeps creating InnoDB when the tables are
> automatically created. (Reason: MyISAM supports full-text searching
> whereas InnoDB doesn't).

You won't have to create tables manually, in one sense. However,
you'll end up doing a bit of indirection; Django will happily output
to a terminal the SQL it's going to execute to create the tables[1],
so you can use that, edit it to specify the table type you want, and
then source the file from inside MySQL.

Also, keep in mind that not using MyISAM means losing transactions.

[1] http://www.djangoproject.com/documentation/django_admin/#sql-appname-appname

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---