Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Does DBI handle table alias?

by punch_card_don (Curate)
on Oct 07, 2004 at 19:16 UTC ( #397409=note: print w/replies, xml ) Need Help??


in reply to Does DBI handle table alias?

A new installement in the saga:

I followed your advice and created indexes, one at a time.

Having an index on each of the columns has reduced response time for the query:

select count(*) from theTable A inner join theTable B where A.column_1 = 123 and B_column_1 = 456 and A.column_2 = B.column_2;

to 30-seconds. A seven fold improvement over 3 1/2 minutes to be sure, but having dozens of these to run while an analyst waits for his page of data, noone's going to wait the 20-minutes or so that will take. The objectives call for 5 to 10 seconds to generate the whole page. I might get away with 15.

Now, these were just plain indexes. Neither column has a clustered index on it, so that'll be the next thing I try, but I somehow doubt even a clustered index is going to reduce my time to the ~0.5 seconds I'm looking for.

Any and all advice will be appreciated. Thanks.

Replies are listed 'Best First'.
Re^2: Does DBI handle table alias?
by The_Rabbit (Acolyte) on Oct 07, 2004 at 20:12 UTC

    I am not exactly sure what you mean by a plain index, but I am pretty sure that adding a clustering index on a field that is already indexed will not really accomplish anything. I could be confusing myself though.

    At this point I think there are two places to looking. First, run the query through whatever explain utilities are available on your DBMS. This may give you some insight into what other optimizations may be useful. This was suggested in a previous post, but may have gotten lost in the shuffle. The other thing to consider is if you have any sort of hardware limitation. E.g. are you running out of RAM on that machine?

    After that, you are going to want to look at if there any database specific options/features you can turn on that may help your query. This type of thing is inherently database specific, and each database usually has a slew of different things you can try. You probably want to find some good perfomance tuning books/references for your database.

    I am a DBA neophyte, so I do not really know if your performance requirements of .5s are reasonable. I will say that 30s for that query sounds like a pretty long time to me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://397409]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2022-08-15 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?