-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The experiment to redesign the critical case for web map #277
Comments
The two SQL case with poor performance
|
@Mohmn I observed a slow case, it takes about 1 minute to finish
The
|
Weird, when I run the
|
A case that takes 90s:
|
The insert to build the denormalized table by Mohmin:
|
For the wallet case, seems we didn't get too much improvement by denormlization, right? @Mohmn
|
The organization case is great, @Mohmn there is a good improvement, I added a index to the jsonb
The SQL to index:
|
The last comparison between: original, array The orignial way to count the tree in org 178(freetown):
The result of array type org info:
These two SQL return the same result: 1794475 |
Some record of creating the data, @Mohmn I create another array column which is simpler to give a organization list that own the tree.
|
Currently, when the app trying to render the map data, it request the db and join the data crossing tables, it is slow, we need to use a special way to give a good way to query and respond quickly, a rough idea is to denormalize the data and avoid crossing join.
The goal:
Some consideration:
organization
table is a tree structure, how do we speed the way to fetch all trees filtered by org (tree)A table structure proposed by @arunbakt :
For example: the tree species, could be put into table: map_features.capture_feature:
attributes: {
species_id: xxx,
species_name: xxx,
}
So we can query the tree with species:
select * from map_features.capture_feature where attributes->species_id = xxxx
The text was updated successfully, but these errors were encountered: