Opened 2 years ago
Closed 2 years ago
#11 closed suggestion (fixed)
De DB functies
| Reported by: | Bart | Owned by: | Bart |
|---|---|---|---|
| Priority: | blocker | Milestone: | |
| Component: | db_schema | Version: | 1.0 |
| Keywords: | Cc: |
Description (last modified by )
identity(){
FROM ads
WHERE tags == query(SELECT tags FROM publisher WHERE property = Referrer )
}
Change History (10)
comment:1 by , 2 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 2 years ago
| Status: | new → accepted |
|---|
comment:3 by , 2 years ago
Now Interesting needs to select from.. ads based on identity... Like, lots of ad candidates.. maybe summarize by count(ad_id) as identity per ad_id? Then.. highest number of keyword matches wins? ORDER BY identity desc LIMIT 1
*edit*
hehe. -- how about targeting of the ad needs to be on point, so a fraction of matched keywords/ad keywords.
comment:4 by , 2 years ago
Uch..
SELECT ads.ad_id, count(*)/(SELECT count(tags) FROM tags WHERE tags.ad_id = ads.ad_id) AS interest FROM ads JOIN tags ON tags.ad_id = ads.ad_id WHERE ads.crude < crude AND charity = s AND tags = (SELECT tags FROM publisher WHERE property = referrer) GROUP BY ads.ad_id ORDER BY interest DESC
Had ik tot nu
comment:5 by , 2 years ago
Maar die count(*)/count(<tags op de ad>) werkt niet
Dat moet ook count(*)/(SELECT count(tags) ... ) zijn
comment:6 by , 2 years ago
DECLARE ad ad_link := interesting(crude, advertising_id, charity, referrer); BEGIN INSERT INTO l (GUID, Forward) VALUES (link_id, ad.link); RETURN ad.image_link; END;
comment:7 by , 2 years ago
SELECT ads.link, ads.image_link from ads WHERE ad_id = (SELECT ad_id FROM public.identity(advertising_id, crude, charity) LIMIT 1)
comment:8 by , 2 years ago
Nu ga ik in zowel de interesting() als identity() de ads tabel in, in identity zelfs met een join op tags, en een select in een where op alle tags in publisher.
Ik weet niet wat dit doet qua performance. Maar een *noot*, de ads tabel 'schoon' houden, en alleen lopende campagnes in hebben staan zal helpen.
comment:9 by , 2 years ago
En, ik verwerk de referrer nog niet naar een tabel om te crawlen.. Ga ik dat doen? <meta keywords>?
comment:10 by , 2 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
foreign table publisher needs to be created