Menu

#1532 Improve performance by putting 'views' fields in separate tables

Approved
closed
None
5
2022-09-11
2022-09-10
Ahasuerus
No

Improve performance by putting 'views' fields in separate tables. Currently every time a user views an Author page the software updates 2 counters in the author table. When a user views a Title page, 2 counters are updated in the title table. This results in a mix of reads and writes from the same table during regular ISFDB operations. It causes a problem when users run Title searches because, as per https://http://books.gigatux.nl/mirror/mysqlcertification/0672326329/ch14lev1sec3.html:

  • If a table is being read from when a write request arrives, the write request cannot be processed until all current readers have finished. Any read requests that arrive after the write request must wait until the write request finishes, even if they arrive before the current readers finish.

Every time a user runs a Title search and another user requests an Author or Title page, this scenario occurs and everyone else gets locked until the Title search finishes.

The solution is to move the "view" counters from the author table and the title table to separate tables.

Discussion

  • Ahasuerus

    Ahasuerus - 2022-09-10
    • status: open --> closed
    • assigned_to: Ahasuerus
     
  • Ahasuerus

    Ahasuerus - 2022-09-10

    Implemented in:

    biblio/biblio.py
    common/SQLparsing.py
    common/titleClass.py
    mod/common.py
    mod/ta_merge.py
    nightly/database_stats.py
    scripts/create_view_tables.sql
    

    Installed in SVN 996 on 2022-09-10. Closing the FR.

     
  • Ahasuerus

    Ahasuerus - 2022-09-11

    Part 2 - Accounted for the changed syntax in MySQL 8.0. Implemented in nightly/database_stats.py, installed in SVN 1000 on 2022-09-11.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB