Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: performance with mysql / file-caching / hash reference on demand

by tobyink (Canon)
on May 02, 2021 at 11:55 UTC ( #11131949=note: print w/replies, xml ) Need Help??


in reply to performance with mysql / file-caching / hash reference on demand

In addition to what afoken said, try adding indices to your table.

CREATE INDEX CT_Media_Relations_ix_SupplierID ON CT_Media_Relations (SupplierID); CREATE INDEX CT_Media_Relations_ix_SupplierPID ON CT_Media_Relations (SupplierPID); -- etc

Indices will somewhat slow down write queries (INSERT, etc) but can have a huge improvement on read queries (SELECT, etc).

Any primary keys will already be indexed, but any other columns containing numbers, dates, and short strings which you frequently filter, sort, or group by should probably be indexed.

  • Comment on Re: performance with mysql / file-caching / hash reference on demand
  • Download Code

Replies are listed 'Best First'.
Re^2: performance with mysql / file-caching / hash reference on demand
by derion (Sexton) on May 02, 2021 at 12:24 UTC
    This would be a very good point but all columns that are in any query are either primary or indxed.

      Too many indexes, or the wrong kinds of indexes, can cause performance problems too.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2021-10-17 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (72 votes). Check out past polls.

    Notices?