Re: Logging all/slow queries

2011-07-19 Thread Justin Holmes
Sometimes I feel like the tool I really need is a "stupid query log." There are times when the ORM produces SQL that is not what I expect, and I often don't realize this until I go and look at the slow query log, which is usually after the project is already in some stage of production or at least

Re: Logging all/slow queries

2011-07-19 Thread Alex Gaynor
On Tue, Jul 19, 2011 at 10:38 AM, Javier Guerra Giraldez wrote: > On Tue, Jul 19, 2011 at 12:16 PM, David wrote: > > This does duplicate > > some functionality of RDBMSs but aggregating queries across multiple > > databases is really convenient rather than having to go to each > > database's log

Re: Logging all/slow queries

2011-07-19 Thread Javier Guerra Giraldez
On Tue, Jul 19, 2011 at 12:16 PM, David wrote: > This does duplicate > some functionality of RDBMSs but aggregating queries across multiple > databases is really convenient rather than having to go to each > database's logs. i'd also like something like that to have better context. for example,

Logging all/slow queries

2011-07-19 Thread David
I think it would be useful to be able to log all queries and/or some "slow" subset of queries in production (DEBUG=False). I understand clearly the reasoning why queries are currently only logged in debug mode, but not all problems crop up in debug mode. This does duplicate some functionality of RD

Re: Storing IP address as integer within database to remove need for full text search

2011-07-19 Thread Daniel Swarbrick
On Jul 19, 2:16 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: > If I was to continue using MySQL for ipv6 storage, I'd probably create a > table with a column for each byte, convert to an int, and apply a unique > index to them all. I think MySQL supports 64 bit ints, so you could split an ipv6

Re: Storing IP address as integer within database to remove need for full text search

2011-07-19 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Jul 19, 2011 at 1:02 PM, Daniel Swarbrick < daniel.swarbr...@gmail.com> wrote: > The snippet seems to have been removed (returns "page not found"). Wtf? :X http://djangosnippets.org/snippets/ Looks like they have suffered some sort of data loss.. I'm seeing only snippets from 2 weeks a

Re: Storing IP address as integer within database to remove need for full text search

2011-07-19 Thread Daniel Swarbrick
The snippet seems to have been removed (returns "page not found"). I was curious to have a look at how you were handling this. For sure, Postgres has native support for ipv4 and ipv6 address storage. AFAIK, MySQL does not... although could store an ipv4 address in a 32-bit unsigned int field. I don