Hirdetés
- Google Pixel topik
- Magisk
- Örömkönnyek és üres kezek a TriFold startjánál
- iPhone topik
- Samsung Galaxy Z Fold7 - ezt vártuk, de…
- Samsung Galaxy S23 Ultra - non plus ultra
- Hazai akkumulátorrekordra pályázik a OnePlus 15R
- Külföldi prepaid SIM-ek itthon
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
- Xiaomi 15 - kicsi telefon nagy energiával
Új hozzászólás Aktív témák
-
trisztan94
őstag
Sziasztok!
MySQL LOAD DATA INFILE-al egy nagy csv-t próbálok importálni adatbázisba. 500.000 sor, 93 oszlop és kb 600mb a fájlméret, InnoDB az AB motor (tudom, hogy MYISAM-al gyorsabb, de kötve vagyunk az innodb-hez).
Ez az import kódom:
$query = "LOAD DATA CONCURRENT LOCAL INFILE '$path'
INTO TABLE task_metas
CHARACTER SET utf8mb4
FIELDS TERMINATED BY '$delimiter'
OPTIONALLY ENCLOSED BY '$enclosed'
LINES TERMINATED BY '$lineending'
IGNORE 1 LINES
(@col1, @col2, @col3, @col4, @col5, @col6, @col7, @col8, @col9, @col10, @col11, @col12, @col13, @col14, @col15, @col16, @col17, @col18, @col19, @col20, @col21, @col22, @col23, @col24, @col25, @col26, @col27, @col28, @col29, @col30, @col31, @col32, @col33, @col34, @col35, @col36, @col37, @col38, @col39, @col40, @col41, @col42, @col43, @col44, @col45, @col46, @col47, @col48, @col49, @col50, @col51, @col52, @col53, @col54, @col55, @col56, @col57, @col58, @col59, @col60, @col61, @col62, @col63, @col64, @col65, @col66, @col67, @col68, @col69, @col70, @col71, @col72, @col73, @col74, @col75, @col76, @col77, @col78, @col79, @col80, @col81, @col82, @col83, @col84, @col85, @col86, @col87, @col88, @col89, @col90, @col91, @col92, @col93)
SET task_id=null, project_id=$project->id, full_comment=null, relevance=-1, note=null,
url=@col1, indexed=@col2, published=@col3, search_indexed=@col4, title_snippet=@col5, content_snippet=@col6, title=@col7, content=@col8, root_url=@col9, domain_url=@col10, host_url=@col11, parent_url=@col12, lang=@col13, porn_level=@col14, fluency_level=@col15, spam_level=@col16, sentiment=@col17, source_type=@col18, post_type=@col19, cluster_id=@col20, meta_cluster_id=@col21, tags_internal=@col22, tags_marking=@col23, tags_customer=@col24, entity_urls=@col25, images_url=@col26, images_width=@col27, images_height=@col28, images_legend=@col29, videos_url=@col30, videos_width=@col31, videos_height=@col32, videos_legend=@col33, pagemonitoring_sitemon_siteid=@col34, matched_profile=@col35, article_extended_attributes_facebook_shares=@col36, article_extended_attributes_facebook_likes=@col37, article_extended_attributes_twitter_retweets=@col38, article_extended_attributes_url_views=@col39, article_extended_attributes_pinterest_likes=@col40, article_extended_attributes_pinterest_pins=@col41, article_extended_attributes_pinterest_repins=@col42, article_extended_attributes_youtube_views=@col43, article_extended_attributes_youtube_likes=@col44, article_extended_attributes_youtube_dislikes=@col45, article_extended_attributes_instagram_likes=@col46, article_extended_attributes_twitter_shares=@col47, article_extended_attributes_num_comments=@col48, source_extended_attributes_alexa_pageviews=@col49, source_extended_attributes_facebook_followers=@col50, source_extended_attributes_twitter_followers=@col51, source_extended_attributes_instagram_followers=@col52, source_extended_attributes_pinterest_followers=@col53, extra_article_attributes_world_data_continent=@col54, extra_article_attributes_world_data_country=@col55, extra_article_attributes_world_data_country_code=@col56, extra_article_attributes_world_data_region=@col57, extra_article_attributes_world_data_city=@col58, extra_article_attributes_world_data_longitude=@col59, extra_article_attributes_world_data_latitude=@col60, extra_author_attributes_id=@col61, extra_author_attributes_type=@col62, extra_author_attributes_name=@col63, extra_author_attributes_birthdate_date=@col64, extra_author_attributes_birthdate_resolution=@col65, extra_author_attributes_gender=@col66, extra_author_attributes_image_url=@col67, extra_author_attributes_short_name=@col68, extra_author_attributes_url=@col69, extra_author_attributes_world_data_continent=@col70, extra_author_attributes_world_data_country=@col71, extra_author_attributes_world_data_country_code=@col72, extra_author_attributes_world_data_region=@col73, extra_author_attributes_world_data_city=@col74, extra_author_attributes_world_data_longitude=@col75, extra_author_attributes_world_data_latitude=@col76, extra_source_attributes_world_data_continent=@col77, extra_source_attributes_world_data_country=@col78, extra_source_attributes_world_data_country_code=@col79, extra_source_attributes_world_data_region=@col80, extra_source_attributes_world_data_city=@col81, extra_source_attributes_world_data_longitude=@col82, extra_source_attributes_world_data_latitude=@col83, engagement=@col84, reach=@col85, provider=@col86, generator_type=@col87, source_extended_attributes_alexa_unique_visitors=@col88, article_extended_attributes_twitter_likes=@col89, extra_author_attributes_description=@col90, article_extended_attributes_linkedin_shares=@col91, extra_source_attributes_name=@col92, word_count=@col93,
created_at=NOW(), updated_at=NOW()";A query futtatása után visszakapok egy számot arról,hogy mennyi sor került be adatbázisba, ami eddig mindig helyes volt.
A probléma az, hogy amikor megnézem az adatbázist, sokszor nem annyi sort pakol be rögtön, mint amenynit visszaad a query. 519.000-nek kellene lennie, de pl. a legutóbbi importnál csak 463.000 volt. Ennél furcsább, hogy ha pár mp múlva újra lekérem az ab táblát, már több sort mutat benne - kb 1000-esével növekedik cca 30mp-enként.
Tehát nagyjából egy 40p alatt felmegy a tényleges 519.000 sorra az inserted sorok száma.
Ez miért van? Olyan, mintha utólag aszinkron pakolná be a sorokat. Ki lehet ezt valahogy kerülni?
+ update
Még az is furcsa, hogy az importált sorok lekérésénél, amikor még fut ez az aszinkron 'utóimport(?)' elszáll a szerver memóriatúllépés miatt, de csak ha azokat a sorokat kérem le. Ha egy korábban futtatott import sorait kérem le, no problemo.
Olyan lehet, hogy a MYSQL szerver lecache-elte azokat a sorokat amire már nem volt elég memóriája és szépen üríti? Szintén szuper lenne ide egy megoldás
Új hozzászólás Aktív témák
- Adobe Indesign
- Mibe tegyem a megtakarításaimat?
- Pánik a memóriapiacon
- Apple asztali gépek
- Google Pixel topik
- Mennyibe fog kerülni a Steam Machine?
- PlayerUnknown’s Battlegrounds
- Intel Core Ultra 3, Core Ultra 5, Ultra 7, Ultra 9 "Arrow Lake" LGA 1851
- Milyen Blu-ray írót?
- sziku69: Szólánc.
- További aktív témák...
- BESZÁMÍTÁS! MSI B460M 10400F 16GB DDR4 512GB SSD RX 6600XT 8GB Rampage SHIVA Cooler Master 650W
- BESZÁMÍTÁS! MSI B450M R5 5500 16GB DDR4 512GB SSD RX 6600XT 8GB DeepCool CC560 Thermaltake 730W
- BESZÁMÍTÁS! ASUS H510M i5 11400F 16GB DDR4 512GB SSD RX 6600XT 8GB Zalman T4 Plus Cooler Master 650W
- BESZÁMÍTÁS! ASUS H510M i5 11400F 16GB DDR4 512GB SSD RX 6700 10GB Zalman T4 Plus Chieftec 650W
- Logitech g25
- Creative Sound BlasterX G6 7.1 USB külső hangkártya
- BESZÁMÍTÁS! MSI B450 R5 5600X 32GB DDR4 512GB SSD RX 6700XT 12GB Zalman Z1 Plus Cooler Master 750W
- ÁRGARANCIA!Épített KomPhone Ryzen 7 7800X3D 32/64GB RAM RTX 5090 32GB GAMER PC termékbeszámítással
- GYÖNYÖRŰ iPhone 12 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3654
- magyar billentyűzet - 165 - Lenovo Legion Pro 7 (16IRX9H) - Intel Core i9-14900HX, RTX 4080
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: ATW Internet Kft.
Város: Budapest



