MS SQl show empty results - sql-server

Below query is matching if the partner code below is having asset code, but if no match its not showing it.
i need even if the partner_code is not having asset code to show any result null or 0
select Asset_code, partner_code from Asset
where PARTNER_CODE in ('28800330',
'28800332',
'28800014',
'41900139',
'28800210',
'29200298',
'29200149',
'29200259',
'29200086',
'29400280',
'29000314',
'29000224',
'29600306',
'29100045',
'29800530',
'29800543',
'29900474',
'29700298',
'27400112',
'27400648',
'27400668',
'85400058',
'27300472',
'53200002',
'27800221',
'27800039',
'27200013')

Related

lapply calling .csv for changes in a parameter

Good afternoon
I am currently trying to pull some data from pushshift but I am maxing out at 100 posts. Below is the code for pulling one day that works great.
testdata1<-getPushshiftData(postType = "submission", size = 1000, before = "1546300800", after= "1546200800", subreddit = "mysubreddit", nest_level = 1)
I have a list of Universal Time Codes for the beginning and ending of each day for a month. What I would like to do is get the syntax to replace the "after" and "before" values for each day and for each day to be added to the end of the pulled data. Even if it placed the data to a bunch of separate smaller datasets I could work with it.
Here is my (feeble) attempt. "links" is the data frame with the UTCs
mydata<- lapply(1:30, function(x) getPushshiftData(postType = "submission", size = 1000, after= links$utcstart[,x],before = links$utcendstart[,x], subreddit = "mysubreddit", nest_level = 1))
Here is the error message I get: Error in links$utcstart[, x] : incorrect number of dimensions
I've also tried without the "function (x)" argument and get the following message:
Error in ifelse(is.null(after), "", sprintf("&after=%s", after)) :
object 'x' not found
Can anyone help with this?

Codeigniter SUM query brings only one row

When I add SUM in Codeigniter SELECT, it returns only one row. But when I remove it, it returns all of the possible matching entries.
$this->db->where('posts.status',1)
->select('posts.title')
->select('posts.description')
->select('posts.posted_by')
->select('posts.posted_on')
->select('posts.category')
->from('posts')
->join('categories','posts.category=categories.id','LEFT')
->select('categories.title as cat_title')
->join('users','users.id=posts.posted_by','LEFT')
->select('users.username')
->select('users.first_name')
->select('users.last_name')
// this section is causing to return only one entry/row,
// when I remove/comment this section, it brings the desired results
->join('votes','votes.post_id=posts.id',"LEFT")
->select('SUM(upvote) as upvote_count')
->select('SUM(downvote) as downvote_count')
->get()
->result_object();
Try to add:
->group_by('posts.id')
After
->select('SUM(downvote) as downvote_count')
So now query will be:
$this->db->where('posts.status',1)
->select('posts.title')
->select('posts.description')
->select('posts.posted_by')
->select('posts.posted_on')
->select('posts.category')
->from('posts')
->join('categories','posts.category=categories.id','LEFT')
->select('categories.title as cat_title')
->join('users','users.id=posts.posted_by','LEFT')
->select('users.username')
->select('users.first_name')
->select('users.last_name')
// this section is causing to return only one entry/row,
// when I remove/comment this section, it brings the desired results
->join('votes','votes.post_id=posts.id',"LEFT")
->select('SUM(upvote) as upvote_count')
->select('SUM(downvote) as downvote_count')
->group_by('posts.id')
->get()
->result_object();

How to display specified table column for Error Number: 22001/8152 SQL Server String or binary data would be truncated?

I get Error Number: 22001/8152
SQL [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]String or binary data would be truncated.
that means
one of my columns in the source table is bigger than my destination columns.
unfortunately that messsage not display which column is it who , I work with much table columns structure it is about 161 column. I think checking one by one my parameter value and column size is not good deal.
is there fastest way to do that?
this is my inssert query look like
INSERT INTO "my_db"."dbo"."my_table" ("Indeks_Keterpaduan", "NA", "admin_pembiayaan", "adopt_b2", "aktivitas_id", "aktivitas_nama", "assessment", "catatan", "dba_", "dlokasi", "dukungan_kawasan", "ikk_id", "ikk_nama", "ikp_id", "ikp_nama", "isu_strategis_id", "isu_strategis_nama", "jaringan_jalan", "jenis_arahan", "jenis_kegiatan", "jenis_kontrakID", "jenis_kontrakNama", "jenis_kotrakKode", "jenis_sub_aktivitas", "kabkot", "kawasan_nama", "kecamatan_id", "kegiatan_id", "kegiatan_nama", "ket_lokasi", "keterangan", "kewenangan", "kode_ssp", "kode_sspn", "kpk", "kws_kode", "outcome_id", "outcome_nama", "output_id", "output_nama", "param_a", "param_b", "param_c", "param_d", "param_e", "param_total", "phln", "politik_anggaran", "prioritas", "program_id", "program_nama", "provinsi_id", "rc_DED", "rc_DEDalokasi", "rc_DEDsatuan", "rc_DEDvol", "rc_Dokling", "rc_Doklingalokasi", "rc_Doklingsatuan", "rc_Doklingvol", "rc_FS", "rc_FSalokasi", "rc_FSsatuan", "rc_FSvol", "rc_dokptanah", "rc_kesesuaian_rtrw", "rc_konstruksi", "rc_konstruksialokasi", "rc_konstruksisatuan", "rc_konstruksivol", "rc_lahan", "rc_lahanalokasi", "rc_lahansatuan", "rc_lahanvol", "rc_masterplan", "rc_pnp1", "rc_pnp2", "rc_proposalpnp", "rc_rdtr", "rc_rdtralokasi", "rc_rdtrsatuan", "rc_rdtrvol", "rc_rispam", "rc_rispamalokasi", "rc_rispamsatuan", "rc_rispamvol", "rc_rp2kpkp", "rc_rp2kpkpalokasi", "rc_rp2kpkpsatuan", "rc_rp2kpkpvol", "rc_rtbl", "rc_rtblalokasi", "rc_rtblsatuan", "rc_rtblvol", "rc_sddt", "rc_skbup", "rc_skbupalokasi", "rc_skbupsatuan", "rc_skbupvol", "rc_skma", "rc_skt", "rc_spb", "rc_spd", "rc_spp", "readines", "rmp", "rpm", "sa1thn_id", "sajp_id", "sastra_id", "sastra_uraian", "satuan_output", "sbsn", "score_admin_pembiayaan", "score_jaringan_jalan", "score_kpk", "score_politik_anggaran", "score_readines", "sinkronisasi", "status", "status_konreg", "status_rakor", "status_verifikasi", "sub_aktivitas", "subkawasan_nama", "suboutput_id", "suboutput_nama", "sumber_arahan", "sumber_dana", "sumber_data_lainnya", "sumber_input_data", "tahun_anggaran", "tapisan", "time_create", "time_update", "total_score", "unit_id", "unit_nama", "uraian_ssp", "uraian_sspn", "user_create", "user_update", "volume", "waa_", "wab_", "wac_", "wba_", "wbb_", "wbc_", "wca_", "wcb_", "wcc_", "wda_", "wdb_", "wdc_", "wps_kode", "wps_nama", "x", "y")values (value1,value2,...,value (n))
Unfortunately, prior to SQL Server 2019, there's no easy way to pinpoint the cause of error msg 8152 "String or Binary data would be truncated".
While not an ideal solution (but it could save your sanity!), what you could do is install a local, side-by-side preview instance of SQL Server 2019, and run your application against it just to get the exact cause of the error!
Ref: String or Binary data would be truncated: replacing the infamous error 8152

Why does ST_Union throw a "TopologyException: side location conflict"?

I'd like to understand the meaning of this error:
Error: ERROR: GEOSUnaryUnion: TopologyException: side location conflict at 509222.06405540626 166742.77073020922
SQLState: XX000
ErrorCode: 0
Given from the following query:
select ST_union(z.geom) from zaz z
Postgis version:
POSTGIS="2.1.0 r11822"
GEOS="3.3.6-CAPI-1.7.6"
PROJ="Rel. 4.8.0, 6 March 2012"
GDAL="GDAL 1.9.2, released 2012/10/08"
LIBXML="2.9.0" RASTER
The problem can be reproduced with this query:
select ST_AsText(ST_Union(z.geom)) from (
select ST_MPolyFromText('MULTIPOLYGON(((513571.981531803 166341.349774259,513116.037800698 166090.997380913,513119.013934713 166083.021341753,513122.34720481 166072.188213938,513124.013839858 166065.997855187,513126.037610988 166046.950597491,513126.037610988 166023.974842894,513117.942526467 165913.024566813,513116.990163582 165897.905806017,513104.966582162 165803.502835059,513104.60944608 165716.718767181,513124.013839858 164966.018723224,513054.967530709 164991.018248951,513040.682087437 164995.065791211,512771.639572476 165072.207184881,512658.070298462 165089.230671447,512620.332919151 165094.825803396,512222.007142577 165144.705809488,512088.319202621 165158.396025957,511825.467046411 165185.300277453,511437.260125488 165216.25207121,511039.767666438 165238.394508282,510637.275302243 165245.299139197,510278.115449307 165247.084819606,509844.671291355 165243.275368066,509480.630578634 165236.01360107,509195.516939992 165227.918516549,508870.642150909 167051.217259529,509104.804375213 166841.340288788,509222.064055406 166742.770730209,509415.631811745 166631.106181965,509727.887792604 166450.871506013,509849.6711965 166401.824817445,509922.407911828 166380.753788619,509986.811451913 166352.659083516,510105.975857876 166299.445807327,510225.259309199 166266.232151719,510464.302393288 166229.209044572,510544.777057055 166213.495056973,510668.227095999 166170.876817877,510762.034840154 166140.282160202,510828.938332812 166126.949079815,510890.365738883 166118.139723131,510959.05491195 166107.782776758,511018.33950153 166100.16387368,511066.076691131 166092.42592524,511097.742757051 166089.211700504,511281.786884542 166098.021057189,511590.471504583 166137.90125299,511730.825984733 166143.853521021,511766.896728995 166143.972566381,511806.419788715 166145.520156069,511905.108392654 166136.353663303,512001.535134742 166108.735139643,512202.95988488 166038.379331527,512434.145975169 165984.332737814,512507.120781218 165968.618750214,512581.643176955 165965.642616199,512654.379892283 166077.307164444,512784.496471421 166043.855418115,512787.948786879 166078.973799492,512787.948786879 166078.973799492,512767.830120937 166133.377529288,512774.020479688 166276.23196201,512799.020005415 166301.350533097,512836.400248644 166276.946234174,512874.018582594 166305.040939276,512838.066883692 166334.564188705,512845.090559968 166427.895751417,512806.996044575 166460.990361664,512846.757195016 166499.561058499,512858.899821797 166718.723567368,512820.329124962 166737.770825064,512833.900296071 166747.532544633,512821.043397126 166755.984765236,512877.708988772 166768.365482739,512893.899157814 166775.627249735,512930.68417424 166780.270018799,512977.469000957 166786.103241468,513181.393703668 166834.554703233,513269.011089071 166852.054371242,513314.605462182 166864.077952663,513568.886352428 166930.624309239,513908.760856946 167004.313387452,513964.593131069 167015.265560627,514336.967019032 167086.454686267,514356.252367449 167090.264137806,514374.10917154 167095.621179034,514433.274715759 166842.649787754,514423.036814747 166834.554703233,514403.037194166 166819.197851716,514302.443864457 166749.675361124,513950.664823878 166560.750373849,513571.981531803 166341.349774259)))') as geom
union
select ST_MPolyFromText('MULTIPOLYGON(((509658.841483455 166823.126348616,509700.031178223 166767.055983772,509737.292376092 166816.816944504,509780.982023433 166778.008156947,509821.338400677 166825.269165106,509862.051914003 166803.960045559,509727.887792604 166450.871506013,509415.631811745 166631.106181965,509480.987714716 166813.959855849,509442.417017881 166923.362542242,509390.751331379 167281.570032294,509425.988758117 167342.997438364,509448.012149829 167345.97357238,509478.963943585 167352.04488577,509503.963469312 167355.021019785,509530.986766168 167357.9971538,509555.986291895 167357.9971538,509583.961951636 167358.949516685,509588.009493897 167357.9971538,509603.009209333 167068.955018259,509651.579716458 167025.622507,509658.841483455 166823.126348616)),((509222.064055406 166742.770730209,509288.967548065 167023.955871951,509248.373080099 167078.002465664,509288.967548065 167023.955871951,509222.064055406 166742.770730209)))') as geom
) z
I'd also like to know if there is a way to "fix" one of the geometries to avoid
the error.
Strangely, if I create a table with a union of the two above selects, and then run an ST_Union, then it doesn't fail.
ST_MakeValid solves the problem.
The result can be passed to ST_Union:
ST_Union(st_makeValid(t.geom))
For the explanation, it could not be better than this one: PostGIS: Tips for power users.

SOLR - How to handle inner Query

How would we query this clause in the SOLR
and (Jobseeker.eid not in (select eid from jobseeker_emailresume where cid = #usecid# and datesent >= #createodbcdate(emaileddate)# ))
To do it in SOLR i am creating list of inner query result and then i am doing like this
-eid: (5210 OR 5357)
It works PERFECT with small data but for large data it generates Error. Like
-eid: (5210 OR 5357 OR 5405 OR 5408 OR 5492 OR 5575 OR 5700 OR 5817 OR 7179 OR 9054 OR 9358 OR 9947 OR 9948 OR 9953 OR 9999 OR 10086 OR 10290 OR 10430 OR 10492 OR 10835 OR 11022 OR 11144 OR 11250 OR 11289 OR 11417 OR 11459 OR 11571 OR 11885 OR 12033 OR 12322 OR 13130 OR 13511 OR 13712 OR 14237 OR 15103 OR 17193 OR 17929 OR 17930 OR 19110 OR 19111 OR 19979 OR 20165 OR 20182 OR 20653 OR 20754 OR 20813 OR 21878 OR 22049 OR 22057 OR 22262 OR 22298 OR 22506 OR 23372 OR 24114 OR 24617 OR 24897 OR 24986 OR 25252 OR 25842 OR 25924 OR 26202 OR 26225 OR 26230 OR 26937 OR 27239 OR 27511 OR 27903 OR 27904 OR 28113 OR 28153 OR 28280 OR 28342 OR 28459 OR 28611 OR 28635 OR 28726 OR 28806 OR 28842 OR 28852 OR 28921 OR 29033 OR 29034 OR 29313 OR 29415 OR 29502 OR 29742 OR 30633 OR 31149 OR 31406 OR 31545 OR 31653 OR 31822 OR 32585 OR 32678 OR 32784 OR 33239 OR 33291 OR 33778 OR 33875 OR 33966 OR 34153 OR 34249 OR 34549 OR 34559 OR 34598 OR 34873 OR 35084 OR 35183 OR 35230 OR 35268 OR 37163 OR 37226 OR 37920 OR 38503 OR 39127 OR 39311 OR 39428 OR 39838 OR 39976 OR 39977 OR 40094 OR 40226 OR 40804 OR 41591 OR 41592 OR 41593 OR 42967 OR 42968 OR 42969 OR 42970 OR 43984 OR 44102 OR 44391 OR 44441 OR 44442 OR 44443 OR 44906 OR 46454 OR 47307 OR 47308 OR 50076 OR 50800 OR 52786 OR 52865 OR 54051 OR 54713 OR 54795 OR 55244 OR 55347 OR 57156 OR 57519 OR 57530 OR 57935 OR 58160 OR 58715 OR 59089 OR 62793 OR 65067 OR 66103 OR 66755 OR 66879 OR 66895 OR 67307 OR 67557 OR 67558 OR 67559 OR 67929 OR 68328 OR 69549 OR 69949 OR 69950 OR 70374 OR 70397 OR 71441 OR 71442 OR 72188 OR 72227 OR 72850 OR 73268 OR 73572 OR 73573 OR 73574 OR 75603 OR 76204 OR 77218 OR 77965 OR 78594 OR 81761 OR 81785 OR 81958 OR 82557 OR 83013 OR 83610 OR 83748 OR 83805 OR 84204 OR 84392 OR 85277 OR 85611 OR 85687 OR 85771 OR 85940 OR 86147 OR 86419 OR 86503 OR 86526 OR 86773 OR 86807 OR 86825 OR 87212 OR 87524 OR 87586 OR 87599 OR 87601 OR 87836 OR 87843 OR 87891 OR 88043 OR 88065 OR 88080 OR 88171 OR 88282 OR 88345 OR 88541 OR 88565 OR 88571 OR 88610 OR 88932 OR 88980 OR 88998 OR 89253 OR 89334 OR 89534 OR 89775 OR 89903 OR 90201 OR 90721 OR 90780 OR 90786 OR 90973 OR 91167 OR 91235 OR 91356 OR 91436 OR 91469 OR 92098 OR 92319 OR 92358 OR 92379 OR 92407 OR 92933 OR 92974 OR 93844 OR 93857 OR 93859 OR 94165 OR 94332 OR 94400 OR 94543 OR 94590 OR 94608 OR 94764 OR 95006 OR 95185 OR 95186 OR 95200 OR 95372 OR 95516 OR 95535 OR 95691 OR 95844 OR 95858 OR 95890 OR 96032 OR 96127 OR 96333 OR 96402 OR 96411 OR 96516 OR 96642 OR 96717 OR 96746 OR 98073 OR 98192 OR 100637 OR 100778 OR 100801 OR 101278 OR 102111 OR 102901 OR 105136 OR 105324 OR 105361 OR 105423 OR 105953 OR 106042 OR 106307 OR 107282 OR 107554 OR 107682 OR 107909 OR 109035 OR 109866 OR 110052 OR 110239 OR 110482 OR 110582 OR 110614 OR 110905 OR 110910 OR 110918 OR 110940 OR 110982 OR 111103 OR 111214 OR 111555 OR 111559 OR 111588 OR 111671 OR 111694 OR 111994 OR 112156 OR 112201 OR 112289 OR 112533 OR 112543 OR 112723 OR 112764 OR 112767 OR 112931 OR 113229 OR 113380 OR 113912 OR 114591 OR 116450 OR 116479 OR 116602 OR 116914 OR 117119 OR 117439 OR 117591 OR 118100 OR 118277 OR 119008 OR 119150 OR 119936 OR 119988 OR 120225 OR 120394 OR 121408 OR 121604 OR 121652 OR 122078 OR 122229 OR 122338 OR 122460 OR 122548 OR 122691 OR 122887 OR 122954 OR 123121 OR 123334 OR 123617 OR 123773 OR 124005 OR 124116 OR 124488 OR 125024 OR 125768 OR 126244 OR 126255 OR 126408 OR 127314 OR 127333 OR 127524 OR 127835 OR 129178 OR 129751 OR 129866 OR 130052 OR 131160 OR 131324 OR 132218 OR 132774 OR 132821 OR 133195 OR 134343 OR 134467 OR 134881 OR 134944 OR 135164 OR 135237 OR 135401 OR 135798 OR 135841 OR 136082 OR 136302 OR 136448 OR 136534 OR 137779 OR 137975 OR 139485 OR 139756 OR 140653 OR 140863 OR 141163 OR 141299 OR 141688 OR 141990 OR 142498 OR 142906 OR 142949 OR 143705 OR 143746 OR 143824 OR 143871 OR 145840 OR 146122 OR 146942 OR 147171 OR 147294 OR 147561 OR 148267 OR 148440 OR 148745 OR 148828 OR 148893 OR 149351 OR 149689 OR 150281 OR 150460 OR 151143 OR 151317 OR 151400 OR 152527 OR 153523 OR 153674 OR 153682 OR 154264 OR 154726 OR 155019 OR 155271 OR 156261 OR 156734 OR 157062 OR 157532 OR 157787 OR 157989 OR 159032 OR 160365 OR 160686 OR 161064 OR 161199 OR 162974 OR 162976 OR 163037 OR 163041 OR 163083 OR 164013 OR 164308 OR 165056 OR 166001 OR 167875 OR 168324 OR 168465 OR 168476 OR 168481 OR 168805 OR 168971 OR 169667 OR 169781 OR 169791 OR 169799 OR 169823 OR 169839 OR 169856 OR 169861 OR 169906 OR 170054 OR 171688 OR 171918 OR 173448 OR 173693 OR 174269 OR 174759 OR 174912 OR 175261 OR 175456 OR 176489 OR 176530 OR 176817 OR 177421 OR 177718 OR 178016 OR 178568 OR 178658 OR 178784 OR 179218 OR 179502 OR 180755 OR 181379 OR 181444 OR 182098 OR 182188 OR 182239 OR 182353 OR 182844 OR 182881 OR 183303 OR 183916 OR 183988 OR 184592 OR 184650 OR 184748 OR 184929 OR 185504 OR 187055 OR 187957 OR 188624 OR 188742 OR 190526 OR 190629 OR 191002 OR 191788 OR 192750 OR 192986 OR 195237 OR 196425 OR 196724 OR 196854 OR 197644 OR 198748 OR 198779 OR 198854 OR 199987 OR 200263 OR 201314 OR 201554 OR 202916 OR 203482 OR 203692 OR 204459 OR 206788 OR 206899 OR 207005 OR 208235 OR 208911 OR 209473 OR 209556 OR 210399 OR 211285 OR 212181 OR 213541 OR 213964 OR 214121 OR 216028 OR 216099 OR 216350 OR 216671 OR 216993 OR 217188 OR 217370 OR 217908 OR 218010 OR 219557 OR 219577 OR 220999 OR 221478 OR 222383 OR 222859 OR 224069 OR 224193 OR 227344 OR 227755 OR 229869 OR 230524 OR 232757 OR 280657 OR 280778 OR 281397 OR 281457 OR 281579 OR 281696 OR 281869 OR 282037 OR 282428 OR 282833 OR 282847 OR 282863 OR 283643 OR 283900 OR 286425 OR 286669 OR 290646 OR 290652 OR 291032 OR 291627 OR 291690 OR 291937 OR 291988 OR 292571 OR 292954 OR 293107 OR 293140 OR 293770 OR 300440 OR 300676 OR 364729 OR 396076 OR 399672 OR 401771 OR 404663 OR 407833 OR 408291 OR 408417 OR 409144 OR 409869 OR 409932 OR 409972 OR 413848 OR 417121 OR 417175 OR 417271 OR 417731 OR 420873 OR 421311 OR 423860 OR 427704 OR 429494 OR 431623 OR 434445 OR 434770 OR 435192 OR 435272 OR 435691 OR 435789 OR 435806 OR 439094 OR 440242 OR 440775 OR 442692 OR 444563 OR 446094 OR 446317 OR 446329 OR 446613 OR 448782 OR 449934 OR 450137 OR 450291 OR 451289 OR 451378 OR 451449 OR 451533 OR 451539 OR 453204 OR 454019 OR 454117 OR 454225 OR 454289 OR 454626 OR 454645 OR 455264 OR 455290 OR 456226 OR 458453 OR 460800 OR 469149 OR 471859 OR 472154 OR 472344 OR 472484 OR 478639 OR 478899 OR 479693 OR 481099 OR 482096 OR 482188 OR 482669 OR 482737 OR 483798 OR 483997 OR 484034 OR 484194 OR 484829 OR 485099 OR 486072 OR 486118 OR 486292 OR 486360 OR 491205 OR 491275 OR 491565 OR 491723 OR 491864 OR 492085 OR 492101 OR 492146 OR 492157 OR 492317 OR 492331 OR 493187 OR 493320 OR 493335 OR 493450 OR 493493 OR 494028 OR 494134 OR 494246 OR 494443 OR 494509 OR 495028 OR 496430 OR 496731 OR 496783 OR 497485 OR 497815 OR 498808 OR 500728 OR 500930 OR 501121 OR 501373 OR 501870 OR 502361 OR 502952 OR 503053 OR 503147 OR 503379 OR 503964 OR 504193 OR 504603 OR 505969 OR 506023 OR 507031 OR 507783 OR 507798 OR 508141 OR 508318 OR 509092 OR 509641 OR 510189 OR 510448 OR 510532 OR 510999 OR 511803 OR 511959 OR 512096 OR 512487 OR 513490 OR 514019 OR 514020 OR 514223 OR 514481 OR 514539 OR 515171 OR 515184 OR 515492 OR 515564 OR 515723 OR 515750 OR 516834 OR 517032 OR 517070 OR 517179 OR 517956 OR 517959 OR 518742 OR 519145 OR 519156 OR 519317 OR 519474 OR 519615 OR 519648 OR 521519 OR 521556 OR 524181 OR 524972 OR 525103 OR 525163)
You need to make sure that your inner query does not exceed the maximum number of allowed boolean clauses. This maximum number can be configured in the configuration script.
Without knowing your domain logic a bit better, you may want to try to denormalize the logic in that subquery into your Solr search query. You have a subquery that's testing values that could themselves be indexed into Solr, allowing you to still do the bulk of your querying from Solr, and saving you from having to pass in a huge list of 'approved' IDs.
Solr by default has a limit of 1,024 OR clauses. If you bump into this limit, you're probably doing something that's not really a good fit for Solr.

Resources