revert to using host id ordering for bundle generation
This commit is contained in:
parent
9266c1417d
commit
1343df1a41
3 changed files with 20 additions and 62 deletions
|
|
@ -21,7 +21,7 @@ SET work_mem = '2GB';
|
|||
\timing on
|
||||
|
||||
CREATE TEMP TABLE best_icons AS
|
||||
SELECT DISTINCT ON (host_id) host_id, icon_hash, downloaded_at
|
||||
SELECT DISTINCT ON (host_id) host_id, icon_hash
|
||||
FROM icons
|
||||
WHERE scan_state = 'completed'
|
||||
AND icon_hash IS NOT NULL
|
||||
|
|
@ -50,7 +50,7 @@ ORDER BY host_id,
|
|||
|
||||
\echo 'Step 2: Updating hosts...'
|
||||
|
||||
UPDATE hosts h SET best_icon_hash = b.icon_hash, icon_downloaded_at = b.downloaded_at
|
||||
UPDATE hosts h SET best_icon_hash = b.icon_hash
|
||||
FROM best_icons b WHERE h.id = b.host_id;
|
||||
|
||||
\timing off
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue