Skip to content

Commit abb68cb

Browse files
committed
new tables for smaller frontend tables
1 parent 76096dc commit abb68cb

File tree

7 files changed

+45
-58
lines changed

7 files changed

+45
-58
lines changed

backend/api_app/controllers/companies.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,9 +927,6 @@ async def adstxt_company_overview(
927927
"""
928928
start = time.perf_counter() * 1000
929929

930-
publisher_id = "pub-3940256099942544"
931-
company_domain = "google.com"
932-
933930
df_apps = get_company_adstxt_publisher_id_apps_overview(
934931
ad_domain_url=company_domain,
935932
publisher_id=publisher_id,

backend/dbcon/sql/query_company_adstxt_ad_domain_overview.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ SELECT
55
developer_count,
66
app_count
77
FROM
8-
adstxt_ad_domain_overview
8+
frontend.adstxt_ad_domain_overview
99
WHERE
1010
ad_domain_url = :ad_domain_url;
Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
SELECT
2-
store,
3-
store_id,
4-
app_name,
5-
app_category,
6-
installs,
7-
rating_count,
8-
developer_id,
9-
developer_name,
10-
developer_domain_url,
11-
relationship,
12-
developer_domain_crawled_at
13-
FROM adstxt_entries_store_apps
2+
sa.store,
3+
sa.store_id,
4+
sa.name AS app_name,
5+
sa.category AS app_category,
6+
sa.installs,
7+
sa.rating_count,
8+
d.developer_id,
9+
d.name AS developer_name,
10+
aesa.developer_domain_url,
11+
aesa.relationship,
12+
aesa.developer_domain_crawled_at
13+
FROM
14+
frontend.adstxt_entries_store_apps AS aesa
15+
LEFT JOIN store_apps AS sa
16+
ON
17+
aesa.store_app = sa.id
18+
LEFT JOIN developers AS d
19+
ON
20+
sa.developer = d.id
1421
WHERE
15-
ad_domain_url = :ad_domain_url
16-
AND publisher_id = :publisher_id
17-
AND store IS NOT NULL;
22+
aesa.ad_domain_url = :ad_domain_url
23+
AND aesa.publisher_id = :publisher_id
24+
AND sa.store IS NOT NULL;

backend/dbcon/sql/query_company_adstxt_publisher_id_apps_overview.sql

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
WITH ranked_apps AS (
22
SELECT
3-
store,
4-
store_id,
5-
app_name,
6-
installs,
7-
rating_count,
8-
developer_id,
9-
developer_name,
10-
developer_domain_url,
11-
relationship,
12-
developer_domain_crawled_at,
3+
sa.store,
4+
sa.store_id,
5+
sa.name AS app_name,
6+
sa.installs,
7+
sa.rating_count,
8+
aesa.developer_domain_url,
9+
aesa.relationship,
10+
aesa.developer_domain_crawled_at,
1311
ROW_NUMBER() OVER (PARTITION BY store, relationship) AS rn
14-
FROM adstxt_entries_store_apps
12+
FROM frontend.adstxt_entries_store_apps AS aesa
13+
LEFT JOIN store_apps AS sa ON aesa.store_app = sa.id
1514
WHERE
1615
ad_domain_url = :ad_domain_url
1716
AND publisher_id = :publisher_id
@@ -23,8 +22,6 @@ SELECT
2322
app_name,
2423
installs,
2524
rating_count,
26-
developer_id,
27-
developer_name,
2825
developer_domain_url,
2926
relationship,
3027
developer_domain_crawled_at
Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
1-
WITH ranked_data AS (
2-
SELECT
3-
*,
4-
ROW_NUMBER() OVER (
5-
PARTITION BY
6-
store,
7-
relationship
8-
ORDER BY
9-
app_count DESC
10-
) AS pubrank
11-
FROM
12-
adstxt_publishers_overview
13-
WHERE
14-
ad_domain_url = :ad_domain_url
15-
AND (publisher_id = :publisher_id OR :publisher_id IS NULL)
16-
)
17-
181
SELECT
192
relationship,
203
store,
214
publisher_id,
225
developer_count,
236
app_count
24-
FROM
25-
ranked_data
7+
FROM frontend.adstxt_publishers_overview
268
WHERE
27-
pubrank <= :pubrank_limit
28-
ORDER BY
29-
store,
30-
pubrank;
9+
ad_domain_url = :ad_domain_url
10+
AND (publisher_id = :publisher_id OR :publisher_id IS NULL)
11+
AND pubrank <= :pubrank_limit
12+
ORDER BY store, pubrank;

backend/dbcon/sql/query_single_app_adstxt.sql

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@ SELECT
44
publisher_id,
55
relationship,
66
developer_domain_crawled_at
7-
FROM adstxt_entries_store_apps
8-
WHERE store_id = :store_id;
7+
FROM
8+
frontend.adstxt_entries_store_apps AS aesa
9+
LEFT JOIN store_apps AS sa
10+
ON
11+
aesa.store_app = sa.id
12+
WHERE
13+
sa.store_id = :store_id;

frontend/src/routes/(categorical)/companies/[domain]/app-adstxt/publisher/[publisher_id]/+page.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts">
22
import { page } from '$app/state';
33
import CompanyPubAppsTable from '$lib/CompanyPubAppsTable.svelte';
4-
import CompanyPubDevsTable from '$lib/CompanyPubDevsTable.svelte';
54
import WhiteCard from '$lib/WhiteCard.svelte';
65
let { data } = $props();
76
</script>

0 commit comments

Comments
 (0)