SQL Analysis

110 views
Skip to first unread message

inerte

unread,
Jun 14, 2010, 5:04:06 PM6/14/10
to sqlparse
Hi Andi!

A long time ago on a badly designed system I inherited, where no
proper care of query volume and optimization was done, I wondered what
table columns I should index.

Which made me wonder, what are the most used columns? What is its
order on sql statements?

Then I thought about writing some kind of sql log parser, extracting
this information (and plenty of others). I was just wondering if you
think your parser has the basis for this functionality. From what I've
seen with the .tokens list, your script can achieve what I want with
some aditional code, which I might do in the following days.

Do you have any insights? I guess I'm asking your blessing, and help,
to hack your code :)

Many thanks,

Andi Albrecht

unread,
Jun 15, 2010, 7:27:37 AM6/15/10
to sqlp...@googlegroups.com
On Mon, Jun 14, 2010 at 11:04 PM, inerte <ine...@gmail.com> wrote:
> Hi Andi!
>
> A long time ago on a badly designed system I inherited, where no
> proper care of query volume and optimization was done, I wondered what
> table columns I should index.
>
> Which made me wonder, what are the most used columns? What is its
> order on sql statements?
>
> Then I thought about writing some kind of sql log parser, extracting
> this information (and plenty of others). I was just wondering if you
> think your parser has the basis for this functionality. From what I've
> seen with the .tokens list, your script can achieve what I want with
> some aditional code, which I might do in the following days.

You're talking about the - still missing - API to inspect a SQL statement... :)
In fact, I'd welcome such an API. As you've already noticed, sqlparse
only supports very low level functions and attributes ATM.

>
> Do you have any insights? I guess I'm asking your blessing, and help,
> to hack your code :)

Patches are welcome! I'd be happy to work on this too!

Andi

>
> Many thanks,
>
> --
> You received this message because you are subscribed to the Google Groups "sqlparse" group.
> To post to this group, send email to sqlp...@googlegroups.com.
> To unsubscribe from this group, send email to sqlparse+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sqlparse?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages