Giter Club home page Giter Club logo

Comments (10)

jkburges avatar jkburges commented on August 15, 2024

Still seems to be slow on prod...

from aatams.

jkburges avatar jkburges commented on August 15, 2024

I have reached the time-box threshold for this bug, henceforth I'm going to document what I know, what I've tried etc. If I think of anything else, I'll add it to the list.

Notes

  • it is the select count(*) with filter applied (i.e. where clause) which is the slow part, although on my development machine, it is not so slow (see [my stackoverflow question]
  • there were some differences w.r.t. to indexes between production and my dev DB, but these differences have now all been eliminated, with little effect. See this SO question for a description of how to list indexes.
    (http://stackoverflow.com/questions/19149585/postgresql-query-plan-discrepancy))
  • the detections materialized view is now truncated before being re-generated. Apart from being much faster to execute, the data in the resulting table should be less bloated
  • with the current design it may be impossible to get the select count to execute in a reasonable amount of time. i.e. clustering the table around the tag ID instance would make filtering by tag ID fast at the expense of filtering by project, for example

from aatams.

jkburges avatar jkburges commented on August 15, 2024

Comparing the same query on imos-2 against my machine, my machine rans the query about 10x faster. Examining the situation with iostat showed that my machine provided approx 2000 IOPS whereas imos-2 provided between 100-200.

We believe that this might be the cause for the x10 slowness witnessed in production.

from aatams.

jkburges avatar jkburges commented on August 15, 2024

Another comparison with imos-2-test (with new storage attached) - the query run time compares with my dev machine (~30s).

The query being:

psql aatams3 -c "select count(*) from detection_extract_view_mv where project = 'AATAMS Rowley shoals';"

from aatams.

jkburges avatar jkburges commented on August 15, 2024

imos-2-test iostat:

image

from aatams.

jkburges avatar jkburges commented on August 15, 2024

Jon's machine iostat:

image

from aatams.

danfruehauf avatar danfruehauf commented on August 15, 2024

After moving to gold storage on NSP:

postgres@imos-2:~$ time psql aatams3 -c "select count(*) from detection_extract_view_mv where project = 'AATAMS Rowley shoals';"
 count  
--------
 268652
(1 row)


real    0m2.595s
user    0m0.084s
sys 0m0.072s

from aatams.

danfruehauf avatar danfruehauf commented on August 15, 2024

After moving to gold storage on NSP:

postgres@imos-2:~$ time psql aatams3 -c "select count(*) from detection_extract_view_mv where project = 'AATAMS Scott reef';"
 count  
--------
 122096
(1 row)


real    0m5.020s
user    0m0.048s
sys 0m0.092s

from aatams.

danfruehauf avatar danfruehauf commented on August 15, 2024

@pblain @jkburges According to Tim "it works like a treat". So I'm happy to close it.

Pete, would you like to have a completed VIT item for that? To be honest the work was done as part of the previous iteration...

from aatams.

pblain avatar pblain commented on August 15, 2024

I'll add the completed VIT so it's in the stats.

from aatams.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.